/// <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);
            }
        }
        /// <summary>
        /// Return a list of books uploaded by the current user.
        /// Documentation https://developers.google.com/books/v1/reference/useruploaded/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, UseruploadedListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Useruploaded.List failed.", ex);
            }
        }
Пример #3
0
        /// <summary>
        /// Gets the annotation data for a volume and layer.
        /// Documentation https://developers.google.com/books/v1/reference/annotationData/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="volumeId">The volume to retrieve annotation data for.</param>
        /// <param name="layerId">The ID for the layer to get the annotation data.</param>
        /// <param name="contentVersion">The content version for the requested volume.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>AnnotationsdataResponse</returns>
        public static Annotationsdata List(booksService service, string volumeId, string layerId, string contentVersion, AnnotationDataListOptionalParms 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 (contentVersion == null)
                {
                    throw new ArgumentNullException(contentVersion);
                }

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

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

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