/// <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);
            }
        }
Пример #2
0
        /// <summary>
        /// Gets the annotation data.
        /// Documentation https://developers.google.com/books/v1/reference/annotationData/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="volumeId">The volume to retrieve annotations for.</param>
        /// <param name="layerId">The ID for the layer to get the annotations.</param>
        /// <param name="annotationDataId">The ID of the annotation data to retrieve.</param>
        /// <param name="contentVersion">The content version for the volume you are trying to retrieve.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>AnnotationdataResponse</returns>
        public static Annotationdata Get(booksService service, string volumeId, string layerId, string annotationDataId, string contentVersion, AnnotationDataGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (volumeId == null)
                {
                    throw new ArgumentNullException(volumeId);
                }
                if (layerId == null)
                {
                    throw new ArgumentNullException(layerId);
                }
                if (annotationDataId == null)
                {
                    throw new ArgumentNullException(annotationDataId);
                }
                if (contentVersion == null)
                {
                    throw new ArgumentNullException(contentVersion);
                }

                // Building the initial request.
                var request = service.AnnotationData.Get(volumeId, layerId, annotationDataId, contentVersion);

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request AnnotationData.Get failed.", ex);
            }
        }
Пример #3
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);
            }
        }
        /// <summary>
        /// Return a list of recommended books for the current user.
        /// Documentation https://developers.google.com/books/v1/reference/recommended/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 books service.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>VolumesResponse</returns>
        public static Volumes List(booksService service, RecommendedListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Recommended.List failed.", ex);
            }
        }
Пример #5
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);
            }
        }
        /// <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);
            }
        }