Параметры метода video.get
Beispiel #1
0
		public ReadOnlyCollection<Video> Get(long? ownerId = null, long? albumId = null, VideoWidth width = VideoWidth.Medium160, int? count = null, int? offset = null, bool extended = false)
        {
            var parameters = new VideoGetParams
			{
				OwnerId = ownerId,
				AlbumId = albumId,
				Count = count,
				Offset = offset,
				Extended = extended
            };
            return Get(parameters);
        }
Beispiel #2
0
        /// <summary>
        /// Привести к типу VkParameters.
        /// </summary>
        /// <param name="p">Параметры.</param>
        /// <returns></returns>
        internal static VkParameters ToVkParameters(VideoGetParams p)
        {
            var parameters = new VkParameters
            {
                { "owner_id", p.OwnerId },
                { "videos", p.Videos?.Select(o => $"{o.OwnerId}_{o.Id}") },
                { "album_id", p.AlbumId },
                { "count", p.Count },
                { "offset", p.Offset },
                { "extended", p.Extended }
            };

            return(parameters);
        }
Beispiel #3
0
        /// <summary>
        /// Привести к типу VkParameters.
        /// </summary>
        /// <param name="p">Параметры.</param>
        /// <returns></returns>
        internal static VkParameters ToVkParameters(VideoGetParams p)
        {
            var parameters = new VkParameters
            {
                { "owner_id", p.OwnerId },
                { "videos", p.Videos },
                { "album_id", p.AlbumId },
                { "count", p.Count },
                { "offset", p.Offset },
                { "extended", p.Extended }
            };

            return parameters;
        }
Beispiel #4
0
        public ReadOnlyCollection<Video> Get(VideoGetParams @params)
        {
            VkErrors.ThrowIfNumberIsNegative(() => @params.AlbumId);
            VkErrors.ThrowIfNumberIsNegative(() => @params.Count);
            VkErrors.ThrowIfNumberIsNegative(() => @params.Offset);

            VkResponseArray response = _vk.Call("video.get", @params);

            return response.ToReadOnlyCollectionOf<Video>(x => x);
        }
Beispiel #5
0
        /// <summary>
        /// Привести к типу VkParameters.
        /// </summary>
        /// <param name="p">Параметры.</param>
        /// <returns></returns>
        public static VkParameters ToVkParameters(VideoGetParams p)
        {
            var parameters = new VkParameters
            {
                { "owner_id", p.OwnerId },
                { "videos", p.Videos?.Select(o => $"{o.OwnerId}_{o.Id}") },
                { "album_id", p.AlbumId },
                { "count", p.Count },
                { "offset", p.Offset },
                { "extended", p.Extended }
            };

            return parameters;
        }