Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }