Example #1
0
        /// <summary>
        /// Gets the metadata of the specifiedPhoto.This method returns the following error codes:* google.rpc.Code.PERMISSION_DENIED if the requesting user did notcreate the requested Photo.* google.rpc.Code.NOT_FOUND if the requestedPhoto does not exist.
        /// Documentation https://developers.google.com/streetviewpublish/v1/reference/photo/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 Streetviewpublish service.</param>
        /// <param name="photoId">Required. ID of the Photo.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>PhotoResponse</returns>
        public static Photo Get(StreetviewpublishService service, string photoId, PhotoGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (photoId == null)
                {
                    throw new ArgumentNullException(photoId);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Photo.Get failed.", ex);
            }
        }
        /// <summary>
        /// Deletes a list of Photos and theirmetadata.Note that ifBatchDeletePhotosfails, either critical fields are missing or there was an authenticationerror. Even ifBatchDeletePhotossucceeds, there may have been failures for single photos in the batch.These failures will be specified in eachPhotoResponse.statusinBatchDeletePhotosResponse.results.SeeDeletePhotofor specific failures that can occur per photo.
        /// Documentation https://developers.google.com/streetviewpublish/v1/reference/photos/batchDelete
        /// 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 Streetviewpublish service.</param>
        /// <param name="body">A valid Streetviewpublish v1 body.</param>
        /// <returns>BatchDeletePhotosResponseResponse</returns>
        public static BatchDeletePhotosResponse BatchDelete(StreetviewpublishService service, BatchDeletePhotosRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.Photos.BatchDelete(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Photos.BatchDelete failed.", ex);
            }
        }
Example #3
0
        /// <summary>
        /// Deletes a Photo and its metadata.This method returns the following error codes:* google.rpc.Code.PERMISSION_DENIED if the requesting user did notcreate the requested photo.* google.rpc.Code.NOT_FOUND if the photo ID does not exist.
        /// Documentation https://developers.google.com/streetviewpublish/v1/reference/photo/delete
        /// 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 Streetviewpublish service.</param>
        /// <param name="photoId">Required. ID of the Photo.</param>
        /// <returns>EmptyResponse</returns>
        public static Empty Delete(StreetviewpublishService service, string photoId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (photoId == null)
                {
                    throw new ArgumentNullException(photoId);
                }

                // Make the request.
                return(service.Photo.Delete(photoId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Photo.Delete failed.", ex);
            }
        }
Example #4
0
        /// <summary>
        /// Creates an upload session to start uploading photo bytes. The upload URL ofthe returned UploadRef is used toupload the bytes for the Photo.In addition to the photo requirements shown inhttps://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604,the photo must also meet the following requirements:* Photo Sphere XMP metadata must be included in the photo medadata. Seehttps://developers.google.com/streetview/spherical-metadata for therequired fields.* The pixel size of the photo must meet the size requirements listed inhttps://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, andthe photo must be a full 360 horizontally.After the upload is complete, theUploadRef is used withCreatePhototo create the Photo object entry.
        /// Documentation https://developers.google.com/streetviewpublish/v1/reference/photo/startUpload
        /// 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 Streetviewpublish service.</param>
        /// <param name="body">A valid Streetviewpublish v1 body.</param>
        /// <returns>UploadRefResponse</returns>
        public static UploadRef StartUpload(StreetviewpublishService service, Empty body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.Photo.StartUpload(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Photo.StartUpload failed.", ex);
            }
        }