예제 #1
0
        public ReadOnlyCollection <long> GetList(LikesGetListParams @params, bool skipAuthorization = true)
        {
            @params.Extended = false;
            VkResponseArray response = _vk.Call("likes.getList", @params, skipAuthorization);

            return(response.ToReadOnlyCollectionOf <long>(x => x));
        }
예제 #2
0
        public LinkAccessType CheckLink([NotNull] string url)
        {
            var parameters = new VkParameters {
                { "url", url }
            };

            return(_vk.Call("utils.checkLink", parameters, true));
        }
예제 #3
0
        public Status Get(long userId, long?groupId = null)
        {
            var parameters = new VkParameters {
                { "user_id", userId },
                { "group_id", groupId }
            };

            return(_vk.Call("status.get", parameters));
        }
예제 #4
0
        public bool CheckPhone(string phone, string clientSecret, long?clientId = null, bool?authByPhone = null)
        {
            var parameters = new VkParameters {
                { "phone", phone },
                { "client_id", clientId },
                { "client_secret", clientSecret },
                { "auth_by_phone", authByPhone }
            };

            return(_vk.Call("auth.checkPhone", parameters));
        }
예제 #5
0
        public VkCollection <Document> Get(int?count = null, int?offset = null, long?ownerId = null, DocFilter?filter = null)
        {
            VkErrors.ThrowIfNumberIsNegative(() => count);
            VkErrors.ThrowIfNumberIsNegative(() => offset);

            var parameters = new VkParameters
            {
                { "count", count },
                { "offset", offset },
                { "owner_id", ownerId },
                { "type", filter }
            };

            return(_vk.Call("docs.get", parameters).ToVkCollectionOf <Document>(r => r));
        }
예제 #6
0
        public ReadOnlyCollection <User> Search(out int itemsCount, UserSearchParams @params)
        {
            var response = _vk.Call("users.search", @params, true);

            itemsCount = response["count"];

            return(response["items"].ToReadOnlyCollectionOf <User>(r => r));
        }
예제 #7
0
        private ReadOnlyCollection <StatsPeriod> Get(DateTime dateFrom, DateTime?dateTo = null, long?groupId = null, long?appId = null)
        {
            var parameters = new VkParameters
            {
                { "group_id", groupId },
                { "app_id", appId },
                { "date_from", dateFrom.ToString("yyyy-MM-dd") }
            };

            if (dateTo != null)
            {
                parameters.Add("date_to", dateTo.Value.ToString("yyyy-MM-dd"));
            }
            var result = _vk.Call("stats.get", parameters);

            return(result.ToReadOnlyCollectionOf <StatsPeriod>(x => x));
        }
예제 #8
0
        public VkCollection <GiftItem> Get(long userId, int?count = null, int?offset = null)
        {
            VkErrors.ThrowIfNumberIsNegative(() => userId);
            var parameters = new VkParameters
            {
                { "user_id", userId },
                { "count", count },
                { "offset", offset }
            };

            return(_vk.Call("gifts.get", parameters).ToVkCollectionOf <GiftItem>(x => x));
        }
예제 #9
0
        public ReadOnlyCollection <Document> Get(out int totalCount, int?count = null, int?offset = null, long?ownerId = null, DocFilter?filter = null)
        {
            VkErrors.ThrowIfNumberIsNegative(() => count);
            VkErrors.ThrowIfNumberIsNegative(() => offset);

            var parameters = new VkParameters
            {
                { "count", count },
                { "offset", offset },
                { "owner_id", ownerId },
                { "type", filter }
            };

            var response = _vk.Call("docs.get", parameters);

            totalCount = response["count"];

            VkResponseArray items = response["items"];

            return(items.ToReadOnlyCollectionOf <Document>(r => r));
        }
예제 #10
0
        public ReadOnlyCollection <App> GetCatalog(out long totalCount, AppGetCatalogParams @params)
        {
            var response = _vk.Call("apps.getCatalog", @params, [email protected]);

            totalCount = response["count"];

            return(response["items"].ToReadOnlyCollectionOf <App>(x => x));
        }
예제 #11
0
        public ReadOnlyCollection <GiftItem> Get(out int totalCount, long userId, int?count = null, int?offset = null)
        {
            VkErrors.ThrowIfNumberIsNegative(() => userId);
            var parameters = new VkParameters
            {
                { "user_id", userId },
                { "count", count },
                { "offset", offset }
            };
            var response = _vk.Call("gifts.get", parameters);

            totalCount = response["count"];
            return(response["items"].ToReadOnlyCollectionOf <GiftItem>(x => x));
        }
예제 #12
0
        public ReadOnlyCollection <User> Get(FriendsGetParams @params)
        {
            var response = _vk.Call("friends.get", @params);

            return(response.ToReadOnlyCollectionOf <User>(x => @params.Fields != null ? x : new User {
                Id = x
            }));
        }
예제 #13
0
 public VkCollection <User> Get(FriendsGetParams @params, bool skipAuthorization = true)
 {
     return(_vk.Call("friends.get", @params, skipAuthorization).ToVkCollectionOf(x => @params.Fields != null ? x : new User {
         Id = x
     }));
 }
예제 #14
0
        public ReadOnlyCollection <User> GetUsers(int?count = null, int?offset = null)
        {
            VkErrors.ThrowIfNumberIsNegative(() => count);
            VkErrors.ThrowIfNumberIsNegative(() => offset);

            var parameters = new VkParameters
            {
                { "count", count },
                { "offset", offset }
            };

            VkResponseArray response = _vk.Call("fave.getUsers", parameters);

            return(response.ToReadOnlyCollectionOf <User>(x => x));
        }
예제 #15
0
 /// <summary>
 /// Универсальный метод, который позволяет запускать последовательность других методов, сохраняя и фильтруя промежуточные результаты.
 /// </summary>
 /// <param name="code">
 /// Код алгоритма в VKScript - формате, похожем на JavaSсript или ActionScript (предполагается совместимость с ECMAScript).
 /// Алгоритм должен завершаться командой return %выражение%. Операторы должны быть разделены точкой с запятой.
 /// </param>
 /// <returns>
 /// Возвращает данные, запрошенные алгоритмом.
 /// При работе с методом execute структура ответа в XML ближе к JSON и может незначительно отличаться от стандартного представления других методов.
 /// </returns>
 /// <remarks>
 /// Страница документации ВКонтакте <see href="http://vk.com/dev/execute" />.
 /// </remarks>
 public VkResponse Execute(string code)
 {
     return(_vk.Call("execute", new VkParameters {
         { "code", HttpUtility.UrlEncode(code) }
     }));
 }
예제 #16
0
        public VkCollection <Market> Get(long ownerId, long?albumId = null, int?count = null, int?offset = null, bool extended = false)
        {
            var parameters = new VkParameters {
                { "owner_id", ownerId },
                { "album_id", albumId },
                { "count", count },
                { "offset", offset },
                { "extended", extended }
            };

            return(_vk.Call("market.get", parameters).ToVkCollectionOf <Market>(x => x));
        }
예제 #17
0
        public WallGetObject Get(WallGetParams @params, bool skipAuthorization = true)
        {
            if (@params.Filter != null && @params.Filter == WallFilter.Suggests && @params.OwnerId >= 0)
            {
                throw new ArgumentException("OwnerID must be negative in case filter equal to Suggests", "ownerId");
            }

            return(_vk.Call("wall.get", @params, skipAuthorization));           //, @params.Filter != WallFilter.Suggests && @params.Filter != WallFilter.Postponed);
        }
예제 #18
0
 /// <summary>
 /// Возвращает список приложений, доступных для пользователей сайта через каталог приложений.
 /// </summary>
 /// <param name="params">Параметры запроса.</param>
 /// <param name="skipAuthorization">Если <c>true<c/>, то пропустить авторизацию</param>
 /// <returns>
 /// После успешного выполнения возвращает общее число найденных приложений и массив объектов приложений.
 /// </returns>
 /// <remarks>
 /// К методу можно делать не более 60 запросов в минуту с одного IP или id.
 /// Страница документации ВКонтакте <seealso cref="http://vk.com/dev/apps.getCatalog" />.
 /// </remarks>
 public VkCollection <App> GetCatalog(AppGetCatalogParams @params, bool skipAuthorization = true)
 {
     return(_vk.Call("apps.getCatalog", @params, skipAuthorization).ToVkCollectionOf <App>(x => x));
 }
예제 #19
0
 public MessagesGetObject Get(MessagesGetParams @params)
 {
     return(_vk.Call("messages.get", @params));
 }
예제 #20
0
        public ReadOnlyCollection <Country> GetCountries(bool?needAll = null, List <Iso3166> codes = null, int?count = null, int?offset = null)
        {
            VkErrors.ThrowIfNumberIsNegative(() => offset);
            VkErrors.ThrowIfNumberIsNegative(() => count);

            var parameters = new VkParameters
            {
                { "code", codes },
                { "offset", offset },
                { "count", count },
                { "need_all", needAll }
            };

            return(_vk.Call("database.getCountries", parameters, true).ToReadOnlyCollectionOf <Country>(x => x));
        }
예제 #21
0
 public Page Get(PagesGetParams @params)
 {
     return(_vk.Call("pages.get", @params));
 }
예제 #22
0
 public VkCollection <User> Search(UserSearchParams @params)
 {
     return(_vk.Call("users.search", @params, false).ToVkCollectionOf <User>(r => r));
 }
예제 #23
0
        public NewsFeed Get(NewsFeedGetParams @params)
        {
            var response = _vk.Call("newsfeed.get", @params);
            var result   = new NewsFeed
            {
                Items     = response["items"].ToReadOnlyCollectionOf <NewsItem>(x => x),
                Profiles  = response["profiles"].ToReadOnlyCollectionOf <User>(x => x),
                Groups    = response["groups"].ToReadOnlyCollectionOf <Group>(x => x),
                NewOffset = response["new_offset"],
                NextFrom  = response["next_from"]
            };

            return(result);
        }
예제 #24
0
 public VkCollection <Topic> GetTopics(BoardGetTopicsParams @params, bool skipAuthorization = true)
 {
     return(_vk.Call("board.getTopics", @params, skipAuthorization).ToVkCollectionOf <Topic>(x => x));
 }
예제 #25
0
        public long GetCount(long ownerId)
        {
            var parameters = new VkParameters
            {
                { "owner_id", ownerId }
            };

            return(_vk.Call("audio.getCount", parameters));
        }
예제 #26
0
 public Counters GetCounters(CountersFilter filter)
 {
     return(_vk.Call("account.getCounters", new VkParameters {
         { "filter", filter }
     }, false));
 }
예제 #27
0
        public bool Join(long?groupId, bool?notSure = null)
        {
            var parameters = new VkParameters {
                { "group_id", groupId },
                { "not_sure", notSure }
            };

            return(_vk.Call("groups.join", parameters));
        }
예제 #28
0
        public VkCollection <User> GetUsers(int?count = null, int?offset = null)
        {
            VkErrors.ThrowIfNumberIsNegative(() => count);
            VkErrors.ThrowIfNumberIsNegative(() => offset);

            var parameters = new VkParameters
            {
                { "count", count },
                { "offset", offset }
            };

            return(_vk.Call("fave.getUsers", parameters).ToVkCollectionOf <User>(x => x));
        }