示例#1
0
        public Task <ApiRequest <IEnumerable <SecureSmsNotification> > > GetSMSHistory(ServiceAccessToken accessToken, int?userId = null, DateTime?dateFrom = null, DateTime?dateTo = null, int?limit = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["user_id"]      = userId?.ToString(),
                ["date_from"]    = RequestHelpers.ParseDateTime(dateFrom),
                ["date_to"]      = RequestHelpers.ParseDateTime(dateTo),
                ["limit"]        = limit?.ToString(),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <SecureSmsNotification> >("secure.getSMSHistory", accessToken, request));
        }
示例#2
0
        public Task <ApiRequest <NewsfeedGetMentionsResponse> > GetMentions(UserAccessToken accessToken, int?ownerId, DateTime?startTime, DateTime?endTime, int?offset, int?count)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["owner_id"]     = ownerId?.ToString(),
                ["start_time"]   = RequestHelpers.ParseDateTime(startTime),
                ["end_time"]     = RequestHelpers.ParseDateTime(endTime),
                ["offset"]       = offset?.ToString(),
                ["count"]        = count?.ToString(),
            };

            return(RequestManager.CreateRequestAsync <NewsfeedGetMentionsResponse>("newsfeed.getMentions", accessToken, request));
        }
示例#3
0
        public Task <ApiRequest <NotificationsGetResponse> > Get(UserAccessToken accessToken, int?count = null, string startFrom = null, IEnumerable <string> filters = null, DateTime?startTime = null, DateTime?endTime = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["count"]        = count?.ToString(),
                ["start_from"]   = startFrom,
                ["filters"]      = RequestHelpers.ParseEnumerable(filters),
                ["start_time"]   = RequestHelpers.ParseDateTime(startTime),
                ["end_time"]     = RequestHelpers.ParseDateTime(endTime),
            };

            return(RequestManager.CreateRequestAsync <NotificationsGetResponse>("notifications.get", accessToken, request));
        }
示例#4
0
        public Task <ApiRequest <NewsfeedGetRecommendedResponse> > GetRecommended(UserAccessToken accessToken, DateTime?startTime, DateTime?endTime, int?maxPhotos, string startFrom, int?count, IEnumerable <string> fields)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["start_time"]   = RequestHelpers.ParseDateTime(startTime),
                ["end_time"]     = RequestHelpers.ParseDateTime(endTime),
                ["max_photos"]   = maxPhotos?.ToString(),
                ["start_from"]   = startFrom,
                ["count"]        = count?.ToString(),
                ["fields"]       = RequestHelpers.ParseEnumerable(fields),
            };

            return(RequestManager.CreateRequestAsync <NewsfeedGetRecommendedResponse>("newsfeed.getRecommended", accessToken, request));
        }
示例#5
0
        public Task <ApiRequest <MessagesSearchResponse> > Search(UserAccessToken accessToken, string q, int?peerId, DateTime?date, int?previewLength, int?offset, int?count)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"]   = accessToken?.Value,
                ["q"]              = q,
                ["peer_id"]        = peerId?.ToString(),
                ["date"]           = RequestHelpers.ParseDateTime(date),
                ["preview_length"] = previewLength?.ToString(),
                ["offset"]         = offset?.ToString(),
                ["count"]          = count?.ToString(),
            };

            return(RequestManager.CreateRequestAsync <MessagesSearchResponse>("messages.search", accessToken, request));
        }
示例#6
0
        public Task <ApiRequest <NewsfeedSearchResponse> > Search(ServiceAccessToken accessToken, string q, int?count, double?latitude, double?longitude, DateTime?startTime, DateTime?endTime, string startFrom, IEnumerable <string> fields)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["q"]            = q,
                ["count"]        = count?.ToString(),
                ["latitude"]     = latitude?.ToString(),
                ["longitude"]    = longitude?.ToString(),
                ["start_time"]   = RequestHelpers.ParseDateTime(startTime),
                ["end_time"]     = RequestHelpers.ParseDateTime(endTime),
                ["start_from"]   = startFrom,
                ["fields"]       = RequestHelpers.ParseEnumerable(fields),
            };

            return(RequestManager.CreateRequestAsync <NewsfeedSearchResponse>("newsfeed.search", accessToken, request));
        }
示例#7
0
        public Task <ApiRequest <PhotosGetResponse> > Get(int?ownerId = null, string albumId = null, IEnumerable <string> photoIds = null, bool?rev = null, string feedType = null, DateTime?feed = null, bool?photoSizes = null, int?offset = null, int?count = null)
        {
            var request = new Dictionary <string, string>
            {
                ["owner_id"]    = ownerId?.ToString(),
                ["album_id"]    = albumId,
                ["photo_ids"]   = RequestHelpers.ParseEnumerable(photoIds),
                ["rev"]         = RequestHelpers.ParseBoolean(rev),
                ["feed_type"]   = feedType,
                ["feed"]        = RequestHelpers.ParseDateTime(feed),
                ["photo_sizes"] = RequestHelpers.ParseBoolean(photoSizes),
                ["offset"]      = offset?.ToString(),
                ["count"]       = count?.ToString(),
            };

            return(RequestManager.CreateRequestAsync <PhotosGetResponse>("photos.get", null, request));
        }
示例#8
0
        public Task <ApiRequest <PlacesGetCheckinsResponse> > GetCheckins(UserAccessToken accessToken, double?latitude = null, double?longitude = null, int?place = null, int?userId = null, DateTime?offset = null, DateTime?count = null, DateTime?timestamp = null, bool?friendsOnly = null, bool?needPlaces = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["latitude"]     = latitude?.ToString(),
                ["longitude"]    = longitude?.ToString(),
                ["place"]        = place?.ToString(),
                ["user_id"]      = userId?.ToString(),
                ["offset"]       = RequestHelpers.ParseDateTime(offset),
                ["count"]        = RequestHelpers.ParseDateTime(count),
                ["timestamp"]    = RequestHelpers.ParseDateTime(timestamp),
                ["friends_only"] = RequestHelpers.ParseBoolean(friendsOnly),
                ["need_places"]  = RequestHelpers.ParseBoolean(needPlaces),
            };

            return(RequestManager.CreateRequestAsync <PlacesGetCheckinsResponse>("places.getCheckins", accessToken, request));
        }
示例#9
0
        public Task <ApiRequest <bool?> > Edit(UserAccessToken accessToken, int?ownerId, int?postId, bool?friendsOnly, string message, IEnumerable <string> attachments, string services, bool?signed, DateTime?publishDate, double?lat, double? @long, int?placeId, bool?markAsAds)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["owner_id"]     = ownerId?.ToString(),
                ["post_id"]      = postId?.ToString(),
                ["friends_only"] = RequestHelpers.ParseBoolean(friendsOnly),
                ["message"]      = message,
                ["attachments"]  = RequestHelpers.ParseEnumerable(attachments),
                ["services"]     = services,
                ["signed"]       = RequestHelpers.ParseBoolean(signed),
                ["publish_date"] = RequestHelpers.ParseDateTime(publishDate),
                ["lat"]          = lat?.ToString(),
                ["long"]         = @long?.ToString(),
                ["place_id"]     = placeId?.ToString(),
                ["mark_as_ads"]  = RequestHelpers.ParseBoolean(markAsAds),
            };

            return(RequestManager.CreateRequestAsync <bool?>("wall.edit", accessToken, request));
        }