public static IPromise <Res.User> Me() { return(get <Res.MeResponse>("/users/me").Then(res => { GraphMap g = new GraphMap(res.graph); return g.User(res.user); })); }
public static IPromise <List <Res.Avatar> > QueryInitial() { return(get <Res.AvatarsResponse>("/avatars/initial").Then(res => { GraphMap g = new GraphMap(res.graph); return g.Avatars(res.avatars); })); }
public static IPromise <Res.Leaflet> GetById(string id) { return(get <Res.LeafletResponse>("/leaflets/" + id) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Leaflet(res.leaflet); })); }
public static IPromise <Res.Protest> GetById(string id) { return(get <Res.ProtestResponse>("/protests/" + id) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Protest(res.protest); })); }
public static IPromise <Res.Place> GetById(uint id) { return(get <Res.PlaceResponse>("/places/" + id.ToString()) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Place(res.place); })); }
/* * GetAll - request all places */ public static IPromise <List <Res.Place> > QueryAll() { return(get <Res.PlacesResponse>("/places") .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Places(res.places); })); }
public static IPromise <List <Res.Event> > QueryNotSeen() { return(get <Res.EventsResponse>("/events") .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Events(res.events); })); }
public static IPromise <List <Res.Signatory> > QuerySignatories(string leafletId) { return(get <Res.SignatoriesResponse>("/leaflets/" + leafletId + "/signatories") .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Signatories(res.signatories); })); }
public static IPromise <List <Res.Participant> > QueryActiveParticipants(string protestId) { return(get <Res.ParticipantsResponse>("/protests/" + protestId + "/activeParticipants") .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Participants(res.participants); })); }
public static IPromise <Res.Leaflet> DestroyLeaflet( string leafletId) { return(post <Res.LeafletResponse>("/leaflets/" + leafletId + "/destroy") .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Leaflet(res.leaflet); })); }
public static IPromise <List <Res.User> > TopOrderUsers(uint start, uint count) { Req.Top req = new Req.Top { start = start, count = count }; return(post <Res.UsersResponse>("/ratings/topOrderUsers", req).Then(res => { GraphMap g = new GraphMap(res.graph); return g.Users(res.users); })); }
public static IPromise <List <Res.Protest> > QueryByIds(List <string> ids) { Req.QueryByIds req = new Req.QueryByIds { ids = ids }; return(post <Res.ProtestsResponse>("/protests/queryByIds", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Protests(res.protests); })); }
public static IPromise <Res.UserAvatar> SetAvatarNickname(string userAvatarId, string nickname) { Req.Nickname req = new Req.Nickname { nickname = nickname }; return(post <Res.UserAvatarResponse>("/user-avatars/" + userAvatarId + "/setNickname", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.UserAvatar(res.userAvatar); })); }
public static IPromise <Res.UserAvatar> SetAvatarType(string userAvatarId, uint avatarId) { Req.SetAvatarType req = new Req.SetAvatarType { avatarId = avatarId }; return(post <Res.UserAvatarResponse>("/user-avatars/" + userAvatarId + "/setType", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.UserAvatar(res.userAvatar); })); }
public static IPromise <List <Res.Banner> > QueryAll(uint protestTypeId, string language) { Dictionary <string, string> args = new Dictionary <string, string> { { "protestTypeId", protestTypeId.ToString() }, { "language", language } }; return(get <Res.Banners>("/banners", args) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Banners(res.banners); })); }
public static IPromise <Res.Participant> LeaveProtest( string protestId, string userAvatarId) { Req.LeaveProtest req = new Req.LeaveProtest { userAvatarId = userAvatarId, }; return(post <Res.ParticipantResponse>("/protests/" + protestId + "/leave", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Participant(res.participant); })); }
public static IPromise <Res.Signatory> SignLeaflet( string leafletId, string bannerId, List <string> bannerWords) { Req.SignLeaflet req = new Req.SignLeaflet { bannerId = bannerId, bannerWords = bannerWords, }; return(post <Res.SignatoryResponse>("/leaflets/" + leafletId + "/sign", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Signatory(res.signatory); })); }
public static IPromise <Res.Participant> JoinProtest( string protestId, string userAvatarId, string bannerId, List <string> bannerWords) { Req.JoinProtest req = new Req.JoinProtest { userAvatarId = userAvatarId, bannerId = bannerId, bannerWords = bannerWords, }; return(post <Res.ParticipantResponse>("/protests/" + protestId + "/join", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Participant(res.participant); })); }
public static IPromise <Res.Leaflet> CreateLeaflet( uint placeId, uint protestTypeId, string bannerId, List <string> bannerWords) { Req.CreateLeaflet req = new Req.CreateLeaflet { placeId = placeId, protestTypeId = protestTypeId, bannerId = bannerId, bannerWords = bannerWords }; return(post <Res.LeafletResponse>("/leaflets", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Leaflet(res.leaflet); })); }
public static IPromise <Res.Protest> CreateProtest( uint placeId, uint protestTypeId, string userAvatarId, string bannerId, List <string> bannerWords, uint duration) { Req.CreateProtest req = new Req.CreateProtest { placeId = placeId, protestTypeId = protestTypeId, userAvatarId = userAvatarId, bannerId = bannerId, bannerWords = bannerWords, duration = duration }; return(post <Res.ProtestResponse>("/protests", req) .Then(res => { GraphMap g = new GraphMap(res.graph); return g.Protest(res.protest); })); }