コード例 #1
0
        /// <summary>
        /// Release downloaded content access restriction.
        /// Documentation https://developers.google.com/books/v1/reference/myconfig/releaseDownloadAccess
        /// 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="volumeIds">The volume(s) to release restrictions for.</param>
        /// <param name="cpksver">The device/version ID from which to release the restriction.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>DownloadAccessesResponse</returns>
        public static DownloadAccesses ReleaseDownloadAccess(booksService service, string volumeIds, string cpksver, MyconfigReleaseDownloadAccessOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (volumeIds == null)
                {
                    throw new ArgumentNullException(volumeIds);
                }
                if (cpksver == null)
                {
                    throw new ArgumentNullException(cpksver);
                }

                // Building the initial request.
                var request = service.Myconfig.ReleaseDownloadAccess(volumeIds, cpksver);

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Myconfig.ReleaseDownloadAccess failed.", ex);
            }
        }
コード例 #2
0
        /// <summary>
        /// Retrieves my reading position information for a volume.
        /// Documentation https://developers.google.com/books/v1/reference/readingpositions/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">ID of volume for which to retrieve a reading position.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ReadingPositionResponse</returns>
        public static ReadingPosition Get(booksService service, string volumeId, ReadingpositionsGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (volumeId == null)
                {
                    throw new ArgumentNullException(volumeId);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Readingpositions.Get failed.", ex);
            }
        }
コード例 #3
0
        /// <summary>
        /// Returns notification details for a given notification id.
        /// Documentation https://developers.google.com/books/v1/reference/notification/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="notification_id">String to identify the notification.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>NotificationResponse</returns>
        public static Notification Get(booksService service, string notification_id, NotificationGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (notification_id == null)
                {
                    throw new ArgumentNullException(notification_id);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Notification.Get failed.", ex);
            }
        }
コード例 #4
0
        /// <summary>
        /// Rate a recommended book for the current user.
        /// Documentation https://developers.google.com/books/v1/reference/recommended/rate
        /// 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="rating">Rating to be given to the volume.</param>
        /// <param name="volumeId">ID of the source volume.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>BooksVolumesRecommendedRateResponseResponse</returns>
        public static BooksVolumesRecommendedRateResponse Rate(booksService service, string rating, string volumeId, RecommendedRateOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (rating == null)
                {
                    throw new ArgumentNullException(rating);
                }
                if (volumeId == null)
                {
                    throw new ArgumentNullException(volumeId);
                }

                // Building the initial request.
                var request = service.Recommended.Rate(rating, volumeId);

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Recommended.Rate failed.", ex);
            }
        }
コード例 #5
0
        /// <summary>
        /// Gets volume information for volumes on a bookshelf.
        /// Documentation https://developers.google.com/books/v1/reference/volumes/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="shelf">The bookshelf ID or name retrieve volumes for.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>VolumesResponse</returns>
        public static Volumes List(booksService service, string shelf, VolumesListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (shelf == null)
                {
                    throw new ArgumentNullException(shelf);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Volumes.List failed.", ex);
            }
        }
コード例 #6
0
        /// <summary>
        /// Gets the current settings for the user.
        /// Documentation https://developers.google.com/books/v1/reference/myconfig/getUserSettings
        /// 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>
        /// <returns>UsersettingsResponse</returns>
        public static Usersettings GetUserSettings(booksService service)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Make the request.
                return(service.Myconfig.GetUserSettings().Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Myconfig.GetUserSettings failed.", ex);
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
0
        /// <summary>
        ///
        /// Documentation https://developers.google.com/books/v1/reference/cloudloading/updateBook
        /// 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="body">A valid books v1 body.</param>
        /// <returns>BooksCloudloadingResourceResponse</returns>
        public static BooksCloudloadingResource UpdateBook(booksService service, BooksCloudloadingResource body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.Cloudloading.UpdateBook(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Cloudloading.UpdateBook failed.", ex);
            }
        }
コード例 #9
0
        /// <summary>
        /// Remove the book and its contents
        /// Documentation https://developers.google.com/books/v1/reference/cloudloading/deleteBook
        /// 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 id of the book to be removed.</param>
        public static void DeleteBook(booksService service, string volumeId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (volumeId == null)
                {
                    throw new ArgumentNullException(volumeId);
                }

                // Make the request.
                return(service.Cloudloading.DeleteBook(volumeId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Cloudloading.DeleteBook failed.", ex);
            }
        }
コード例 #10
0
        /// <summary>
        /// Returns a list of offline dictionary metadata available
        /// Documentation https://developers.google.com/books/v1/reference/dictionary/listOfflineMetadata
        /// 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="cpksver">The device/version ID from which to request the data.</param>
        /// <returns>MetadataResponse</returns>
        public static Metadata ListOfflineMetadata(booksService service, string cpksver)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (cpksver == null)
                {
                    throw new ArgumentNullException(cpksver);
                }

                // Make the request.
                return(service.Dictionary.ListOfflineMetadata(cpksver).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Dictionary.ListOfflineMetadata failed.", ex);
            }
        }
コード例 #11
0
        /// <summary>
        /// Request downloaded content access for specified volumes on the My eBooks shelf.
        /// Documentation https://developers.google.com/books/v1/reference/myconfig/syncVolumeLicenses
        /// 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="nonce">The client nonce value.</param>
        /// <param name="cpksver">The device/version ID from which to release the restriction.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>VolumesResponse</returns>
        public static Volumes SyncVolumeLicenses(booksService service, string source, string nonce, string cpksver, MyconfigSyncVolumeLicensesOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (source == null)
                {
                    throw new ArgumentNullException(source);
                }
                if (nonce == null)
                {
                    throw new ArgumentNullException(nonce);
                }
                if (cpksver == null)
                {
                    throw new ArgumentNullException(cpksver);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Myconfig.SyncVolumeLicenses failed.", ex);
            }
        }
コード例 #12
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);
            }
        }
コード例 #13
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);
            }
        }
コード例 #14
0
        /// <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);
            }
        }