/// <summary>
        /// Request concurrent and download access restrictions.
        /// Documentation https://developers.google.com/books/v1/reference/myconfig/requestAccess
        /// 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 Books service.</param>
        /// <param name="source">String to identify the originator of this request.</param>
        /// <param name="volumeId">The volume to request concurrent/download restrictions for.</param>
        /// <param name="nonce">The client nonce value.</param>
        /// <param name="cpksver">The device/version ID from which to request the restrictions.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>RequestAccessResponse</returns>
        public static RequestAccess RequestAccess(BooksService service, string source, string volumeId, string nonce, string cpksver, MyconfigRequestAccessOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (source == null)
                {
                    throw new ArgumentNullException(source);
                }
                if (volumeId == null)
                {
                    throw new ArgumentNullException(volumeId);
                }
                if (nonce == null)
                {
                    throw new ArgumentNullException(nonce);
                }
                if (cpksver == null)
                {
                    throw new ArgumentNullException(cpksver);
                }

                // Building the initial request.
                var request = service.Myconfig.RequestAccess(source, volumeId, nonce, cpksver);

                // Applying optional parameters to the request.
                request = (MyconfigResource.RequestAccessRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Myconfig.RequestAccess failed.", ex);
            }
        }
        /// <summary>
        /// Returns a stream of personalized book clusters
        /// Documentation https://developers.google.com/books/v1/reference/personalizedstream/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 Books service.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>DiscoveryclustersResponse</returns>
        public static Discoveryclusters Get(BooksService service, PersonalizedstreamGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Personalizedstream.Get();

                // Applying optional parameters to the request.
                request = (PersonalizedstreamResource.GetRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Personalizedstream.Get failed.", ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// List categories for onboarding experience.
        /// Documentation https://developers.google.com/books/v1/reference/onboarding/listCategories
        /// 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 Books service.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>CategoryResponse</returns>
        public static Category ListCategories(BooksService service, OnboardingListCategoriesOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Onboarding.ListCategories();

                // Applying optional parameters to the request.
                request = (OnboardingResource.ListCategoriesRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Onboarding.ListCategories failed.", ex);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// Documentation https://developers.google.com/books/v1/reference/promooffer/accept
        /// 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 Books service.</param>
        /// <param name="optional">Optional paramaters.</param>
        public static void Accept(BooksService service, PromoofferAcceptOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Promooffer.Accept();

                // Applying optional parameters to the request.
                request = (PromoofferResource.AcceptRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                request.Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Promooffer.Accept failed.", ex);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// Documentation https://developers.google.com/books/v1/reference/cloudloading/addBook
        /// 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 Books service.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>BooksCloudloadingResourceResponse</returns>
        public static BooksCloudloadingResource AddBook(BooksService service, CloudloadingAddBookOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Cloudloading.AddBook();

                // Applying optional parameters to the request.
                request = (CloudloadingResource.AddBookRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Cloudloading.AddBook failed.", ex);
            }
        }