Class: Google::Apis::StreetviewpublishV1::StreetViewPublishService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::StreetviewpublishV1::StreetViewPublishService
- Defined in:
- generated/google/apis/streetviewpublish_v1/service.rb
Overview
Street View Publish API
Publishes 360 photos to Google Maps, along with position, orientation, and connectivity metadata. Apps can offer an interface for positioning, connecting, and uploading user-generated Street View images.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#batch_delete_photos(batch_delete_photos_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse
Deletes a list of Photos and their metadata.
-
#batch_photo_get(photo_ids: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse
Gets the metadata of the specified Photo batch.
-
#batch_update_photos(batch_update_photos_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse
Updates the metadata of Photos, such as pose, place association, connections, etc.
-
#create_photo(photo_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Photo
After the client finishes uploading the photo with the returned UploadRef, CreatePhoto publishes the uploaded Photo to Street View on Google Maps.
-
#delete_photo(photo_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Empty
Deletes a Photo and its metadata.
-
#get_photo(photo_id, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Photo
Gets the metadata of the specified Photo.
-
#initialize ⇒ StreetViewPublishService
constructor
A new instance of StreetViewPublishService.
-
#list_photos(filter: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::ListPhotosResponse
Lists all the Photos that belong to the user.
-
#start_photo_upload(empty_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::UploadRef
Creates an upload session to start uploading photo bytes.
-
#update_photo(id, photo_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Photo
Updates the metadata of a Photo, such as pose, place association, connections, etc.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ StreetViewPublishService
Returns a new instance of StreetViewPublishService
47 48 49 50 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 47 def initialize super('https://streetviewpublish.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
40 41 42 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#batch_delete_photos(batch_delete_photos_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse
Deletes a list of Photos and their metadata. Note that if BatchDeletePhotos fails, either critical fields are missing or there was an authentication error. Even if BatchDeletePhotos succeeds, there may have been failures for single photos in the batch. These failures will be specified in each PhotoResponse.status in BatchDeletePhotosResponse.results. See DeletePhoto for specific failures that can occur per photo.
315 316 317 318 319 320 321 322 323 324 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 315 def batch_delete_photos(batch_delete_photos_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/photos:batchDelete', ) command.request_representation = Google::Apis::StreetviewpublishV1::BatchDeletePhotosRequest::Representation command.request_object = batch_delete_photos_request_object command.response_representation = Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse::Representation command.response_class = Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#batch_photo_get(photo_ids: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse
Gets the metadata of the specified Photo batch. Note that if BatchGetPhotos fails, either critical fields are missing or there was an authentication error. Even if BatchGetPhotos succeeds, there may have been failures for single photos in the batch. These failures will be specified in each PhotoResponse.status in BatchGetPhotosResponse.results. See GetPhoto for specific failures that can occur per photo.
365 366 367 368 369 370 371 372 373 374 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 365 def batch_photo_get(photo_ids: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/photos:batchGet', ) command.response_representation = Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse::Representation command.response_class = Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse command.query['photoIds'] = photo_ids unless photo_ids.nil? command.query['view'] = view unless view.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#batch_update_photos(batch_update_photos_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse
Updates the metadata of Photos, such
as pose, place association, connections, etc. Changing the pixels of photos
is not supported.
Note that if
BatchUpdatePhotos
fails, either critical fields are missing or there was an authentication
error. Even if
BatchUpdatePhotos
succeeds, there may have been failures for single photos in the batch.
These failures will be specified in each
PhotoResponse.status
in
BatchUpdatePhotosResponse.results.
See
UpdatePhoto
for specific failures that can occur per photo.
Only the fields specified in
updateMask
field are used. If updateMask
is not present, the update applies to all
fields.
418 419 420 421 422 423 424 425 426 427 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 418 def batch_update_photos(batch_update_photos_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/photos:batchUpdate', ) command.request_representation = Google::Apis::StreetviewpublishV1::BatchUpdatePhotosRequest::Representation command.request_object = batch_update_photos_request_object command.response_representation = Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse::Representation command.response_class = Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_photo(photo_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Photo
After the client finishes uploading the photo with the returned UploadRef, CreatePhoto publishes the uploaded Photo to Street View on Google Maps. This method returns the following error codes:
- google.rpc.Code.INVALID_ARGUMENT if the request is malformed.
- google.rpc.Code.NOT_FOUND if the upload reference does not exist.
- google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the storage limit.
80 81 82 83 84 85 86 87 88 89 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 80 def create_photo(photo_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/photo', ) command.request_representation = Google::Apis::StreetviewpublishV1::Photo::Representation command.request_object = photo_object command.response_representation = Google::Apis::StreetviewpublishV1::Photo::Representation command.response_class = Google::Apis::StreetviewpublishV1::Photo command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_photo(photo_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Empty
Deletes a Photo and its metadata. This method returns the following error codes:
- google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the requested photo.
- google.rpc.Code.NOT_FOUND if the photo ID does not exist.
115 116 117 118 119 120 121 122 123 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 115 def delete_photo(photo_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/photo/{photoId}', ) command.response_representation = Google::Apis::StreetviewpublishV1::Empty::Representation command.response_class = Google::Apis::StreetviewpublishV1::Empty command.params['photoId'] = photo_id unless photo_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_photo(photo_id, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Photo
Gets the metadata of the specified Photo. This method returns the following error codes:
- google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the requested Photo.
- google.rpc.Code.NOT_FOUND if the requested Photo does not exist.
154 155 156 157 158 159 160 161 162 163 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 154 def get_photo(photo_id, view: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/photo/{photoId}', ) command.response_representation = Google::Apis::StreetviewpublishV1::Photo::Representation command.response_class = Google::Apis::StreetviewpublishV1::Photo command.params['photoId'] = photo_id unless photo_id.nil? command.query['view'] = view unless view.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_photos(filter: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::ListPhotosResponse
Lists all the Photos that belong to the user.
465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 465 def list_photos(filter: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/photos', ) command.response_representation = Google::Apis::StreetviewpublishV1::ListPhotosResponse::Representation command.response_class = Google::Apis::StreetviewpublishV1::ListPhotosResponse command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['view'] = view unless view.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#start_photo_upload(empty_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::UploadRef
Creates an upload session to start uploading photo bytes. The upload URL of the returned UploadRef is used to upload the bytes for the Photo. In addition to the photo requirements shown in https://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. See https://developers.google.com/streetview/spherical-metadata for the required fields.
- The pixel size of the photo must meet the size requirements listed in https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and the photo must be a full 360 horizontally. After the upload is complete, the UploadRef is used with CreatePhoto to create the Photo object entry.
199 200 201 202 203 204 205 206 207 208 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 199 def start_photo_upload(empty_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/photo:startUpload', ) command.request_representation = Google::Apis::StreetviewpublishV1::Empty::Representation command.request_object = empty_object command.response_representation = Google::Apis::StreetviewpublishV1::UploadRef::Representation command.response_class = Google::Apis::StreetviewpublishV1::UploadRef command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_photo(id, photo_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StreetviewpublishV1::Photo
Updates the metadata of a Photo, such
as pose, place association, connections, etc. Changing the pixels of a
photo is not supported.
Only the fields specified in the
updateMask
field are used. If updateMask
is not present, the update applies to all
fields.
This method returns the following error codes:
- google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the requested photo.
- google.rpc.Code.INVALID_ARGUMENT if the request is malformed.
- google.rpc.Code.NOT_FOUND if the requested photo does not exist.
269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'generated/google/apis/streetviewpublish_v1/service.rb', line 269 def update_photo(id, photo_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v1/photo/{id}', ) command.request_representation = Google::Apis::StreetviewpublishV1::Photo::Representation command.request_object = photo_object command.response_representation = Google::Apis::StreetviewpublishV1::Photo::Representation command.response_class = Google::Apis::StreetviewpublishV1::Photo command.params['id'] = id unless id.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |