Ejemplo n.º 1
0
        /// <summary>
        /// Sends a message.
        /// </summary>
        public Task <ApiRequest <IEnumerable <object> > > SendApi(int?userId = null, int?randomId = null, int?peerId = null, string domain = null, int?chatId = null, IEnumerable <int> userIds = null, string message = null, double?lat = null, double? @long = null, string attachment = null, int?replyTo = null, IEnumerable <int> forwardMessages = null, string forward = null, int?stickerId = null, int?groupId = null, string keyboard = null, string payload = null, bool?dontParseLinks = null, bool?disableMentions = null)
        {
            var request = new Dictionary <string, string>
            {
                ["user_id"]          = userId?.ToString(),
                ["random_id"]        = randomId?.ToString(),
                ["peer_id"]          = peerId?.ToString(),
                ["domain"]           = domain,
                ["chat_id"]          = chatId?.ToString(),
                ["user_ids"]         = RequestHelpers.ParseEnumerable(userIds),
                ["message"]          = message,
                ["lat"]              = lat?.ToString(),
                ["long"]             = @long?.ToString(),
                ["attachment"]       = attachment,
                ["reply_to"]         = replyTo?.ToString(),
                ["forward_messages"] = RequestHelpers.ParseEnumerable(forwardMessages),
                ["forward"]          = forward,
                ["sticker_id"]       = stickerId?.ToString(),
                ["group_id"]         = groupId?.ToString(),
                ["keyboard"]         = keyboard,
                ["payload"]          = payload,
                ["dont_parse_links"] = RequestHelpers.ParseBoolean(dontParseLinks),
                ["disable_mentions"] = RequestHelpers.ParseBoolean(disableMentions),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <object> >("messages.send", null, request));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Allows to show stories from hidden sources in current user's feed.
        /// </summary>
        public Task <ApiRequest <bool?> > UnbanOwnerApi(IEnumerable <int> ownersIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["owners_ids"] = RequestHelpers.ParseEnumerable(ownersIds),
            };

            return(RequestManager.CreateRequestAsync <bool?>("stories.unbanOwner", null, request));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns information about countries by their IDs.
        /// </summary>
        public Task <ApiRequest <IEnumerable <BaseCountry> > > GetCountriesByIdApi(IEnumerable <int> countryIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["country_ids"] = RequestHelpers.ParseEnumerable(countryIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <BaseCountry> >("database.getCountriesById", null, request));
        }
Ejemplo n.º 4
0
        public Task <ApiRequest <bool?> > ReorderTagsApi(IEnumerable <int> ids = null)
        {
            var request = new Dictionary <string, string>
            {
                ["ids"] = RequestHelpers.ParseEnumerable(ids),
            };

            return(RequestManager.CreateRequestAsync <bool?>("fave.reorderTags", null, request));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Returns one of the previously set game levels of one or more users in the application.
        /// </summary>
        public Task <ApiRequest <IEnumerable <SecureLevel> > > GetUserLevelApi(IEnumerable <int> userIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["user_ids"] = RequestHelpers.ParseEnumerable(userIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <SecureLevel> >("secure.getUserLevel", null, request));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Returns non-null values of user counters.
        /// </summary>
        public Task <ApiRequest <AccountAccountCounters> > GetCountersApi(IEnumerable <string> filter = null)
        {
            var request = new Dictionary <string, string>
            {
                ["filter"] = RequestHelpers.ParseEnumerable(filter),
            };

            return(RequestManager.CreateRequestAsync <AccountAccountCounters>("account.getCounters", null, request));
        }
Ejemplo n.º 7
0
        public Task <ApiRequest <IEnumerable <DatabaseStreet> > > GetStreetsById(IEnumerable <int?> streetIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["street_ids"] = RequestHelpers.ParseEnumerable(streetIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <DatabaseStreet> >("database.getStreetsById", null, request));
        }
Ejemplo n.º 8
0
        public Task <ApiRequest <IEnumerable <BaseObject> > > GetCitiesById(IEnumerable <int?> cityIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["city_ids"] = RequestHelpers.ParseEnumerable(cityIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <BaseObject> >("database.getCitiesById", null, request));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Returns current account info.
        /// </summary>
        public Task <ApiRequest <AccountInfo> > GetInfoApi(IEnumerable <string> fields = null)
        {
            var request = new Dictionary <string, string>
            {
                ["fields"] = RequestHelpers.ParseEnumerable(fields),
            };

            return(RequestManager.CreateRequestAsync <AccountInfo>("account.getInfo", null, request));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Returns information about documents by their IDs.
        /// </summary>
        public Task <ApiRequest <IEnumerable <DocsDoc> > > GetByIdApi(IEnumerable <string> docs = null)
        {
            var request = new Dictionary <string, string>
            {
                ["docs"] = RequestHelpers.ParseEnumerable(docs),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <DocsDoc> >("docs.getById", null, request));
        }
Ejemplo n.º 11
0
        public Task <ApiRequest <IEnumerable <BaseObject> > > GetCitiesById(ServiceAccessToken accessToken, IEnumerable <int?> cityIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["city_ids"]     = RequestHelpers.ParseEnumerable(cityIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <BaseObject> >("database.getCitiesById", accessToken, request));
        }
Ejemplo n.º 12
0
        public Task <ApiRequest <MessagesGetByIdResponse> > GetById(GroupAccessToken accessToken, IEnumerable <int?> messageIds)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["message_ids"]  = RequestHelpers.ParseEnumerable(messageIds),
            };

            return(RequestManager.CreateRequestAsync <MessagesGetByIdResponse>("messages.getById", accessToken, request));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Creates a new friend list for the current user.
        /// </summary>
        public Task <ApiRequest <FriendsAddListResponse> > AddListApi(string name = null, IEnumerable <int> userIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["name"]     = name,
                ["user_ids"] = RequestHelpers.ParseEnumerable(userIds),
            };

            return(RequestManager.CreateRequestAsync <FriendsAddListResponse>("friends.addList", null, request));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Returns a list of newsfeeds followed by the current user.
        /// </summary>
        public Task <ApiRequest <NewsfeedGetListsExtendedResponse> > GetListsApi(IEnumerable <int> listIds = null, bool?extended = null)
        {
            var request = new Dictionary <string, string>
            {
                ["list_ids"] = RequestHelpers.ParseEnumerable(listIds),
                ["extended"] = RequestHelpers.ParseBoolean(extended),
            };

            return(RequestManager.CreateRequestAsync <NewsfeedGetListsExtendedResponse>("newsfeed.getLists", null, request));
        }
Ejemplo n.º 15
0
        public Task <ApiRequest <MarketGetByIdResponse> > GetById(UserAccessToken accessToken, IEnumerable <string> itemIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["item_ids"]     = RequestHelpers.ParseEnumerable(itemIds),
            };

            return(RequestManager.CreateRequestAsync <MarketGetByIdResponse>("market.getById", accessToken, request));
        }
Ejemplo n.º 16
0
        public Task <ApiRequest <AccountAccountCounters> > GetCounters(UserAccessToken accessToken, IEnumerable <string> filter = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["filter"]       = RequestHelpers.ParseEnumerable(filter),
            };

            return(RequestManager.CreateRequestAsync <AccountAccountCounters>("account.getCounters", accessToken, request));
        }
Ejemplo n.º 17
0
        public Task <ApiRequest <IEnumerable <PlacesPlaceMin> > > GetById(UserAccessToken accessToken, IEnumerable <int?> places = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["places"]       = RequestHelpers.ParseEnumerable(places),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <PlacesPlaceMin> >("places.getById", accessToken, request));
        }
Ejemplo n.º 18
0
        public Task <ApiRequest <IEnumerable <DocsDoc> > > GetById(UserAccessToken accessToken, IEnumerable <string> docs = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["docs"]         = RequestHelpers.ParseEnumerable(docs),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <DocsDoc> >("docs.getById", accessToken, request));
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Edits the friend lists of the selected user.
        /// </summary>
        public Task <ApiRequest <bool?> > EditApi(int?userId = null, IEnumerable <int> listIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["user_id"]  = userId?.ToString(),
                ["list_ids"] = RequestHelpers.ParseEnumerable(listIds),
            };

            return(RequestManager.CreateRequestAsync <bool?>("friends.edit", null, request));
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Checks the current user's friendship status with other specified users.
        /// </summary>
        public Task <ApiRequest <IEnumerable <FriendsFriendStatus> > > AreFriendsApi(IEnumerable <int> userIds = null, bool?needSign = null)
        {
            var request = new Dictionary <string, string>
            {
                ["user_ids"]  = RequestHelpers.ParseEnumerable(userIds),
                ["need_sign"] = RequestHelpers.ParseBoolean(needSign),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <FriendsFriendStatus> >("friends.areFriends", null, request));
        }
Ejemplo n.º 21
0
        public Task <ApiRequest <IEnumerable <DatabaseStreet> > > GetStreetsById(UserAccessToken accessToken, IEnumerable <int?> streetIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["street_ids"]   = RequestHelpers.ParseEnumerable(streetIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <DatabaseStreet> >("database.getStreetsById", accessToken, request));
        }
Ejemplo n.º 22
0
        public Task <ApiRequest <NewsfeedGetListsResponse> > GetLists(UserAccessToken accessToken, IEnumerable <int?> listIds)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["list_ids"]     = RequestHelpers.ParseEnumerable(listIds),
            };

            return(RequestManager.CreateRequestAsync <NewsfeedGetListsResponse>("newsfeed.getLists", accessToken, request));
        }
Ejemplo n.º 23
0
        public Task <ApiRequest <IEnumerable <PhotosPhoto> > > GetById(IEnumerable <string> photos = null, bool?photoSizes = null)
        {
            var request = new Dictionary <string, string>
            {
                ["photos"]      = RequestHelpers.ParseEnumerable(photos),
                ["photo_sizes"] = RequestHelpers.ParseBoolean(photoSizes),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <PhotosPhoto> >("photos.getById", null, request));
        }
Ejemplo n.º 24
0
        public Task <ApiRequest <IEnumerable <PrettyCardsPrettyCard> > > GetByIdApi(int?ownerId = null, IEnumerable <int> cardIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["owner_id"] = ownerId?.ToString(),
                ["card_ids"] = RequestHelpers.ParseEnumerable(cardIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <PrettyCardsPrettyCard> >("prettyCards.getById", null, request));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Allows news from previously banned users and communities to be shown in the current user's newsfeed.
        /// </summary>
        public Task <ApiRequest <bool?> > DeleteBanApi(IEnumerable <int> userIds = null, IEnumerable <int> groupIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["user_ids"]  = RequestHelpers.ParseEnumerable(userIds),
                ["group_ids"] = RequestHelpers.ParseEnumerable(groupIds),
            };

            return(RequestManager.CreateRequestAsync <bool?>("newsfeed.deleteBan", null, request));
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Returns a list of the current user's friends whose phone numbers, validated or specified in a profile, are in a given list.
        /// </summary>
        public Task <ApiRequest <IEnumerable <FriendsUserXtrPhone> > > GetByPhonesApi(IEnumerable <string> phones = null, IEnumerable <UsersFields> fields = null)
        {
            var request = new Dictionary <string, string>
            {
                ["phones"] = RequestHelpers.ParseEnumerable(phones),
                ["fields"] = RequestHelpers.ParseEnumerable(fields),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <FriendsUserXtrPhone> >("friends.getByPhones", null, request));
        }
Ejemplo n.º 27
0
        public Task <ApiRequest <GroupsGetCallbackServersResponse> > GetCallbackServersApi(int?groupId = null, IEnumerable <int> serverIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["group_id"]   = groupId?.ToString(),
                ["server_ids"] = RequestHelpers.ParseEnumerable(serverIds),
            };

            return(RequestManager.CreateRequestAsync <GroupsGetCallbackServersResponse>("groups.getCallbackServers", null, request));
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Marks and unmarks messages as important (starred).
        /// </summary>
        public Task <ApiRequest <IEnumerable <int> > > MarkAsImportantApi(IEnumerable <int> messageIds = null, int?important = null)
        {
            var request = new Dictionary <string, string>
            {
                ["message_ids"] = RequestHelpers.ParseEnumerable(messageIds),
                ["important"]   = important?.ToString(),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <int> >("messages.markAsImportant", null, request));
        }
Ejemplo n.º 29
0
        public Task <ApiRequest <IEnumerable <SecureLevel> > > GetUserLevel(ServiceAccessToken accessToken, IEnumerable <int?> userIds = null)
        {
            var request = new Dictionary <string, string>
            {
                ["access_token"] = accessToken?.Value,
                ["user_ids"]     = RequestHelpers.ParseEnumerable(userIds),
            };

            return(RequestManager.CreateRequestAsync <IEnumerable <SecureLevel> >("secure.getUserLevel", accessToken, request));
        }
Ejemplo n.º 30
0
        public Task <ApiRequest <OrdersAmount> > GetAmount(int?userId = null, IEnumerable <string> votes = null)
        {
            var request = new Dictionary <string, string>
            {
                ["user_id"] = userId?.ToString(),
                ["votes"]   = RequestHelpers.ParseEnumerable(votes),
            };

            return(RequestManager.CreateRequestAsync <OrdersAmount>("orders.getAmount", null, request));
        }