Пример #1
0
        /// <summary>
        /// Get a Component given its id.
        /// Documentation https://developers.google.com/playmovies/v1/reference/type/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated PlayMovies service.</param>
        /// <param name="accountId">REQUIRED. See _General rules_ for more information about this field.</param>
        /// <param name="componentId">REQUIRED. Component ID.</param>
        /// <param name="type">REQUIRED. Component Type.</param>
        /// <returns>ComponentResponse</returns>
        public static Component Get(PlayMoviesService service, string accountId, string componentId, string type)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }
                if (componentId == null)
                {
                    throw new ArgumentNullException(componentId);
                }
                if (type == null)
                {
                    throw new ArgumentNullException(type);
                }

                // Make the request.
                return(service.Type.Get(accountId, componentId, type).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Type.Get failed.", ex);
            }
        }
Пример #2
0
        /// <summary>
        /// List Avails owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.
        /// Documentation https://developers.google.com/playmovies/v1/reference/avails/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated PlayMovies service.</param>
        /// <param name="accountId">REQUIRED. See _General rules_ for more information about this field.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ListAvailsResponseResponse</returns>
        public static ListAvailsResponse List(PlayMoviesService service, string accountId, AvailsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }

                // Building the initial request.
                var request = service.Avails.List(accountId);

                // Applying optional parameters to the request.
                request = (AvailsResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Avails.List failed.", ex);
            }
        }
Пример #3
0
        /// <summary>
        /// Get an Avail given its avail group id and avail id.
        /// Documentation https://developers.google.com/playmovies/v1/reference/avails/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated PlayMovies service.</param>
        /// <param name="accountId">REQUIRED. See _General rules_ for more information about this field.</param>
        /// <param name="availId">REQUIRED. Avail ID.</param>
        /// <returns>AvailResponse</returns>
        public static Avail Get(PlayMoviesService service, string accountId, string availId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }
                if (availId == null)
                {
                    throw new ArgumentNullException(availId);
                }

                // Make the request.
                return(service.Avails.Get(accountId, availId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Avails.Get failed.", ex);
            }
        }
        /// <summary>
        /// Get a StoreInfo given its video id and country. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method.
        /// Documentation https://developers.google.com/playmovies/v1/reference/country/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated PlayMovies service.</param>
        /// <param name="accountId">REQUIRED. See _General rules_ for more information about this field.</param>
        /// <param name="videoId">REQUIRED. Video ID.</param>
        /// <param name="country">REQUIRED. Edit country.</param>
        /// <returns>StoreInfoResponse</returns>
        public static StoreInfo Get(PlayMoviesService service, string accountId, string videoId, string country)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }
                if (videoId == null)
                {
                    throw new ArgumentNullException(videoId);
                }
                if (country == null)
                {
                    throw new ArgumentNullException(country);
                }

                // Make the request.
                return(service.Country.Get(accountId, videoId, country).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Country.Get failed.", ex);
            }
        }