google-apis-streetviewpublish_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module StreetviewpublishV1
18
+ # Version of the google-apis-streetviewpublish_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201012"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,319 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module StreetviewpublishV1
24
+
25
+ class BatchDeletePhotosRequest
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class BatchDeletePhotosResponse
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class BatchGetPhotosResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class BatchUpdatePhotosRequest
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class BatchUpdatePhotosResponse
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class Connection
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Empty
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class LatLng
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class Level
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class ListPhotosResponse
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class Operation
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class Photo
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class PhotoId
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class PhotoResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class Place
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class Pose
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Status
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class UpdatePhotoRequest
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class UploadRef
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class BatchDeletePhotosRequest
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ collection :photo_ids, as: 'photoIds'
143
+ end
144
+ end
145
+
146
+ class BatchDeletePhotosResponse
147
+ # @private
148
+ class Representation < Google::Apis::Core::JsonRepresentation
149
+ collection :status, as: 'status', class: Google::Apis::StreetviewpublishV1::Status, decorator: Google::Apis::StreetviewpublishV1::Status::Representation
150
+
151
+ end
152
+ end
153
+
154
+ class BatchGetPhotosResponse
155
+ # @private
156
+ class Representation < Google::Apis::Core::JsonRepresentation
157
+ collection :results, as: 'results', class: Google::Apis::StreetviewpublishV1::PhotoResponse, decorator: Google::Apis::StreetviewpublishV1::PhotoResponse::Representation
158
+
159
+ end
160
+ end
161
+
162
+ class BatchUpdatePhotosRequest
163
+ # @private
164
+ class Representation < Google::Apis::Core::JsonRepresentation
165
+ collection :update_photo_requests, as: 'updatePhotoRequests', class: Google::Apis::StreetviewpublishV1::UpdatePhotoRequest, decorator: Google::Apis::StreetviewpublishV1::UpdatePhotoRequest::Representation
166
+
167
+ end
168
+ end
169
+
170
+ class BatchUpdatePhotosResponse
171
+ # @private
172
+ class Representation < Google::Apis::Core::JsonRepresentation
173
+ collection :results, as: 'results', class: Google::Apis::StreetviewpublishV1::PhotoResponse, decorator: Google::Apis::StreetviewpublishV1::PhotoResponse::Representation
174
+
175
+ end
176
+ end
177
+
178
+ class Connection
179
+ # @private
180
+ class Representation < Google::Apis::Core::JsonRepresentation
181
+ property :target, as: 'target', class: Google::Apis::StreetviewpublishV1::PhotoId, decorator: Google::Apis::StreetviewpublishV1::PhotoId::Representation
182
+
183
+ end
184
+ end
185
+
186
+ class Empty
187
+ # @private
188
+ class Representation < Google::Apis::Core::JsonRepresentation
189
+ end
190
+ end
191
+
192
+ class LatLng
193
+ # @private
194
+ class Representation < Google::Apis::Core::JsonRepresentation
195
+ property :latitude, as: 'latitude'
196
+ property :longitude, as: 'longitude'
197
+ end
198
+ end
199
+
200
+ class Level
201
+ # @private
202
+ class Representation < Google::Apis::Core::JsonRepresentation
203
+ property :name, as: 'name'
204
+ property :number, as: 'number'
205
+ end
206
+ end
207
+
208
+ class ListPhotosResponse
209
+ # @private
210
+ class Representation < Google::Apis::Core::JsonRepresentation
211
+ property :next_page_token, as: 'nextPageToken'
212
+ collection :photos, as: 'photos', class: Google::Apis::StreetviewpublishV1::Photo, decorator: Google::Apis::StreetviewpublishV1::Photo::Representation
213
+
214
+ end
215
+ end
216
+
217
+ class Operation
218
+ # @private
219
+ class Representation < Google::Apis::Core::JsonRepresentation
220
+ property :done, as: 'done'
221
+ property :error, as: 'error', class: Google::Apis::StreetviewpublishV1::Status, decorator: Google::Apis::StreetviewpublishV1::Status::Representation
222
+
223
+ hash :metadata, as: 'metadata'
224
+ property :name, as: 'name'
225
+ hash :response, as: 'response'
226
+ end
227
+ end
228
+
229
+ class Photo
230
+ # @private
231
+ class Representation < Google::Apis::Core::JsonRepresentation
232
+ property :capture_time, as: 'captureTime'
233
+ collection :connections, as: 'connections', class: Google::Apis::StreetviewpublishV1::Connection, decorator: Google::Apis::StreetviewpublishV1::Connection::Representation
234
+
235
+ property :download_url, as: 'downloadUrl'
236
+ property :maps_publish_status, as: 'mapsPublishStatus'
237
+ property :photo_id, as: 'photoId', class: Google::Apis::StreetviewpublishV1::PhotoId, decorator: Google::Apis::StreetviewpublishV1::PhotoId::Representation
238
+
239
+ collection :places, as: 'places', class: Google::Apis::StreetviewpublishV1::Place, decorator: Google::Apis::StreetviewpublishV1::Place::Representation
240
+
241
+ property :pose, as: 'pose', class: Google::Apis::StreetviewpublishV1::Pose, decorator: Google::Apis::StreetviewpublishV1::Pose::Representation
242
+
243
+ property :share_link, as: 'shareLink'
244
+ property :thumbnail_url, as: 'thumbnailUrl'
245
+ property :transfer_status, as: 'transferStatus'
246
+ property :upload_reference, as: 'uploadReference', class: Google::Apis::StreetviewpublishV1::UploadRef, decorator: Google::Apis::StreetviewpublishV1::UploadRef::Representation
247
+
248
+ property :view_count, :numeric_string => true, as: 'viewCount'
249
+ end
250
+ end
251
+
252
+ class PhotoId
253
+ # @private
254
+ class Representation < Google::Apis::Core::JsonRepresentation
255
+ property :id, as: 'id'
256
+ end
257
+ end
258
+
259
+ class PhotoResponse
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ property :photo, as: 'photo', class: Google::Apis::StreetviewpublishV1::Photo, decorator: Google::Apis::StreetviewpublishV1::Photo::Representation
263
+
264
+ property :status, as: 'status', class: Google::Apis::StreetviewpublishV1::Status, decorator: Google::Apis::StreetviewpublishV1::Status::Representation
265
+
266
+ end
267
+ end
268
+
269
+ class Place
270
+ # @private
271
+ class Representation < Google::Apis::Core::JsonRepresentation
272
+ property :language_code, as: 'languageCode'
273
+ property :name, as: 'name'
274
+ property :place_id, as: 'placeId'
275
+ end
276
+ end
277
+
278
+ class Pose
279
+ # @private
280
+ class Representation < Google::Apis::Core::JsonRepresentation
281
+ property :accuracy_meters, as: 'accuracyMeters'
282
+ property :altitude, as: 'altitude'
283
+ property :heading, as: 'heading'
284
+ property :lat_lng_pair, as: 'latLngPair', class: Google::Apis::StreetviewpublishV1::LatLng, decorator: Google::Apis::StreetviewpublishV1::LatLng::Representation
285
+
286
+ property :level, as: 'level', class: Google::Apis::StreetviewpublishV1::Level, decorator: Google::Apis::StreetviewpublishV1::Level::Representation
287
+
288
+ property :pitch, as: 'pitch'
289
+ property :roll, as: 'roll'
290
+ end
291
+ end
292
+
293
+ class Status
294
+ # @private
295
+ class Representation < Google::Apis::Core::JsonRepresentation
296
+ property :code, as: 'code'
297
+ collection :details, as: 'details'
298
+ property :message, as: 'message'
299
+ end
300
+ end
301
+
302
+ class UpdatePhotoRequest
303
+ # @private
304
+ class Representation < Google::Apis::Core::JsonRepresentation
305
+ property :photo, as: 'photo', class: Google::Apis::StreetviewpublishV1::Photo, decorator: Google::Apis::StreetviewpublishV1::Photo::Representation
306
+
307
+ property :update_mask, as: 'updateMask'
308
+ end
309
+ end
310
+
311
+ class UploadRef
312
+ # @private
313
+ class Representation < Google::Apis::Core::JsonRepresentation
314
+ property :upload_url, as: 'uploadUrl'
315
+ end
316
+ end
317
+ end
318
+ end
319
+ end
@@ -0,0 +1,446 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module StreetviewpublishV1
23
+ # Street View Publish API
24
+ #
25
+ # Publishes 360 photos to Google Maps, along with position, orientation, and
26
+ # connectivity metadata. Apps can offer an interface for positioning, connecting,
27
+ # and uploading user-generated Street View images.
28
+ #
29
+ # @example
30
+ # require 'google/apis/streetviewpublish_v1'
31
+ #
32
+ # Streetviewpublish = Google::Apis::StreetviewpublishV1 # Alias the module
33
+ # service = Streetviewpublish::StreetViewPublishService.new
34
+ #
35
+ # @see https://developers.google.com/streetview/publish/
36
+ class StreetViewPublishService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://streetviewpublish.googleapis.com/', '',
49
+ client_name: 'google-apis-streetviewpublish_v1',
50
+ client_version: Google::Apis::StreetviewpublishV1::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # After the client finishes uploading the photo with the returned UploadRef,
55
+ # CreatePhoto publishes the uploaded Photo to Street View on Google Maps.
56
+ # Currently, the only way to set heading, pitch, and roll in CreatePhoto is
57
+ # through the [Photo Sphere XMP metadata](https://developers.google.com/
58
+ # streetview/spherical-metadata) in the photo bytes. CreatePhoto ignores the `
59
+ # pose.heading`, `pose.pitch`, `pose.roll`, `pose.altitude`, and `pose.level`
60
+ # fields in Pose. This method returns the following error codes: * google.rpc.
61
+ # Code.INVALID_ARGUMENT if the request is malformed or if the uploaded photo is
62
+ # not a 360 photo. * google.rpc.Code.NOT_FOUND if the upload reference does not
63
+ # exist. * google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the
64
+ # storage limit.
65
+ # @param [Google::Apis::StreetviewpublishV1::Photo] photo_object
66
+ # @param [String] fields
67
+ # Selector specifying which fields to include in a partial response.
68
+ # @param [String] quota_user
69
+ # Available to use for quota purposes for server-side applications. Can be any
70
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
71
+ # @param [Google::Apis::RequestOptions] options
72
+ # Request-specific options
73
+ #
74
+ # @yield [result, err] Result & error if block supplied
75
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::Photo] parsed result object
76
+ # @yieldparam err [StandardError] error object if request failed
77
+ #
78
+ # @return [Google::Apis::StreetviewpublishV1::Photo]
79
+ #
80
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
81
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
82
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
83
+ def create_photo(photo_object = nil, fields: nil, quota_user: nil, options: nil, &block)
84
+ command = make_simple_command(:post, 'v1/photo', options)
85
+ command.request_representation = Google::Apis::StreetviewpublishV1::Photo::Representation
86
+ command.request_object = photo_object
87
+ command.response_representation = Google::Apis::StreetviewpublishV1::Photo::Representation
88
+ command.response_class = Google::Apis::StreetviewpublishV1::Photo
89
+ command.query['fields'] = fields unless fields.nil?
90
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
91
+ execute_or_queue_command(command, &block)
92
+ end
93
+
94
+ # Deletes a Photo and its metadata. This method returns the following error
95
+ # codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did not
96
+ # create the requested photo. * google.rpc.Code.NOT_FOUND if the photo ID does
97
+ # not exist.
98
+ # @param [String] photo_id
99
+ # Required. ID of the Photo.
100
+ # @param [String] fields
101
+ # Selector specifying which fields to include in a partial response.
102
+ # @param [String] quota_user
103
+ # Available to use for quota purposes for server-side applications. Can be any
104
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
105
+ # @param [Google::Apis::RequestOptions] options
106
+ # Request-specific options
107
+ #
108
+ # @yield [result, err] Result & error if block supplied
109
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::Empty] parsed result object
110
+ # @yieldparam err [StandardError] error object if request failed
111
+ #
112
+ # @return [Google::Apis::StreetviewpublishV1::Empty]
113
+ #
114
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
115
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
116
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
117
+ def delete_photo(photo_id, fields: nil, quota_user: nil, options: nil, &block)
118
+ command = make_simple_command(:delete, 'v1/photo/{photoId}', options)
119
+ command.response_representation = Google::Apis::StreetviewpublishV1::Empty::Representation
120
+ command.response_class = Google::Apis::StreetviewpublishV1::Empty
121
+ command.params['photoId'] = photo_id unless photo_id.nil?
122
+ command.query['fields'] = fields unless fields.nil?
123
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
124
+ execute_or_queue_command(command, &block)
125
+ end
126
+
127
+ # Gets the metadata of the specified Photo. This method returns the following
128
+ # error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did
129
+ # not create the requested Photo. * google.rpc.Code.NOT_FOUND if the requested
130
+ # Photo does not exist. * google.rpc.Code.UNAVAILABLE if the requested Photo is
131
+ # still being indexed.
132
+ # @param [String] photo_id
133
+ # Required. ID of the Photo.
134
+ # @param [String] language_code
135
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information,
136
+ # see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If
137
+ # language_code is unspecified, the user's language preference for Google
138
+ # services is used.
139
+ # @param [String] view
140
+ # Required. Specifies if a download URL for the photo bytes should be returned
141
+ # in the Photo response.
142
+ # @param [String] fields
143
+ # Selector specifying which fields to include in a partial response.
144
+ # @param [String] quota_user
145
+ # Available to use for quota purposes for server-side applications. Can be any
146
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
147
+ # @param [Google::Apis::RequestOptions] options
148
+ # Request-specific options
149
+ #
150
+ # @yield [result, err] Result & error if block supplied
151
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::Photo] parsed result object
152
+ # @yieldparam err [StandardError] error object if request failed
153
+ #
154
+ # @return [Google::Apis::StreetviewpublishV1::Photo]
155
+ #
156
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
157
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
158
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
159
+ def get_photo(photo_id, language_code: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
160
+ command = make_simple_command(:get, 'v1/photo/{photoId}', options)
161
+ command.response_representation = Google::Apis::StreetviewpublishV1::Photo::Representation
162
+ command.response_class = Google::Apis::StreetviewpublishV1::Photo
163
+ command.params['photoId'] = photo_id unless photo_id.nil?
164
+ command.query['languageCode'] = language_code unless language_code.nil?
165
+ command.query['view'] = view unless view.nil?
166
+ command.query['fields'] = fields unless fields.nil?
167
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
168
+ execute_or_queue_command(command, &block)
169
+ end
170
+
171
+ # Creates an upload session to start uploading photo bytes. The method uses the
172
+ # upload URL of the returned UploadRef to upload the bytes for the Photo. In
173
+ # addition to the photo requirements shown in https://support.google.com/maps/
174
+ # answer/7012050?hl=en&ref_topic=6275604, the photo must meet the following
175
+ # requirements: * Photo Sphere XMP metadata must be included in the photo
176
+ # metadata. See https://developers.google.com/streetview/spherical-metadata for
177
+ # the required fields. * The pixel size of the photo must meet the size
178
+ # requirements listed in https://support.google.com/maps/answer/7012050?hl=en&
179
+ # ref_topic=6275604, and the photo must be a full 360 horizontally. After the
180
+ # upload completes, the method uses UploadRef with CreatePhoto to create the
181
+ # Photo object entry.
182
+ # @param [Google::Apis::StreetviewpublishV1::Empty] empty_object
183
+ # @param [String] fields
184
+ # Selector specifying which fields to include in a partial response.
185
+ # @param [String] quota_user
186
+ # Available to use for quota purposes for server-side applications. Can be any
187
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
188
+ # @param [Google::Apis::RequestOptions] options
189
+ # Request-specific options
190
+ #
191
+ # @yield [result, err] Result & error if block supplied
192
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::UploadRef] parsed result object
193
+ # @yieldparam err [StandardError] error object if request failed
194
+ #
195
+ # @return [Google::Apis::StreetviewpublishV1::UploadRef]
196
+ #
197
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
198
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
199
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
200
+ def start_photo_upload(empty_object = nil, fields: nil, quota_user: nil, options: nil, &block)
201
+ command = make_simple_command(:post, 'v1/photo:startUpload', options)
202
+ command.request_representation = Google::Apis::StreetviewpublishV1::Empty::Representation
203
+ command.request_object = empty_object
204
+ command.response_representation = Google::Apis::StreetviewpublishV1::UploadRef::Representation
205
+ command.response_class = Google::Apis::StreetviewpublishV1::UploadRef
206
+ command.query['fields'] = fields unless fields.nil?
207
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
208
+ execute_or_queue_command(command, &block)
209
+ end
210
+
211
+ # Updates the metadata of a Photo, such as pose, place association, connections,
212
+ # etc. Changing the pixels of a photo is not supported. Only the fields
213
+ # specified in the updateMask field are used. If `updateMask` is not present,
214
+ # the update applies to all fields. This method returns the following error
215
+ # codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did not
216
+ # create the requested photo. * google.rpc.Code.INVALID_ARGUMENT if the request
217
+ # is malformed. * google.rpc.Code.NOT_FOUND if the requested photo does not
218
+ # exist. * google.rpc.Code.UNAVAILABLE if the requested Photo is still being
219
+ # indexed.
220
+ # @param [String] id
221
+ # Required. A unique identifier for a photo.
222
+ # @param [Google::Apis::StreetviewpublishV1::Photo] photo_object
223
+ # @param [String] update_mask
224
+ # Required. Mask that identifies fields on the photo metadata to update. If not
225
+ # present, the old Photo metadata is entirely replaced with the new Photo
226
+ # metadata in this request. The update fails if invalid fields are specified.
227
+ # Multiple fields can be specified in a comma-delimited list. The following
228
+ # fields are valid: * `pose.heading` * `pose.latLngPair` * `pose.pitch` * `pose.
229
+ # roll` * `pose.level` * `pose.altitude` * `connections` * `places` *Note:* When
230
+ # updateMask contains repeated fields, the entire set of repeated values get
231
+ # replaced with the new contents. For example, if updateMask contains `
232
+ # connections` and `UpdatePhotoRequest.photo.connections` is empty, all
233
+ # connections are removed.
234
+ # @param [String] fields
235
+ # Selector specifying which fields to include in a partial response.
236
+ # @param [String] quota_user
237
+ # Available to use for quota purposes for server-side applications. Can be any
238
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
239
+ # @param [Google::Apis::RequestOptions] options
240
+ # Request-specific options
241
+ #
242
+ # @yield [result, err] Result & error if block supplied
243
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::Photo] parsed result object
244
+ # @yieldparam err [StandardError] error object if request failed
245
+ #
246
+ # @return [Google::Apis::StreetviewpublishV1::Photo]
247
+ #
248
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
249
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
250
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
251
+ def update_photo(id, photo_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
252
+ command = make_simple_command(:put, 'v1/photo/{id}', options)
253
+ command.request_representation = Google::Apis::StreetviewpublishV1::Photo::Representation
254
+ command.request_object = photo_object
255
+ command.response_representation = Google::Apis::StreetviewpublishV1::Photo::Representation
256
+ command.response_class = Google::Apis::StreetviewpublishV1::Photo
257
+ command.params['id'] = id unless id.nil?
258
+ command.query['updateMask'] = update_mask unless update_mask.nil?
259
+ command.query['fields'] = fields unless fields.nil?
260
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
261
+ execute_or_queue_command(command, &block)
262
+ end
263
+
264
+ # Deletes a list of Photos and their metadata. Note that if BatchDeletePhotos
265
+ # fails, either critical fields are missing or there is an authentication error.
266
+ # Even if BatchDeletePhotos succeeds, individual photos in the batch may have
267
+ # failures. These failures are specified in each PhotoResponse.status in
268
+ # BatchDeletePhotosResponse.results. See DeletePhoto for specific failures that
269
+ # can occur per photo.
270
+ # @param [Google::Apis::StreetviewpublishV1::BatchDeletePhotosRequest] batch_delete_photos_request_object
271
+ # @param [String] fields
272
+ # Selector specifying which fields to include in a partial response.
273
+ # @param [String] quota_user
274
+ # Available to use for quota purposes for server-side applications. Can be any
275
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
276
+ # @param [Google::Apis::RequestOptions] options
277
+ # Request-specific options
278
+ #
279
+ # @yield [result, err] Result & error if block supplied
280
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse] parsed result object
281
+ # @yieldparam err [StandardError] error object if request failed
282
+ #
283
+ # @return [Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse]
284
+ #
285
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
286
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
287
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
288
+ def batch_delete_photos(batch_delete_photos_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
289
+ command = make_simple_command(:post, 'v1/photos:batchDelete', options)
290
+ command.request_representation = Google::Apis::StreetviewpublishV1::BatchDeletePhotosRequest::Representation
291
+ command.request_object = batch_delete_photos_request_object
292
+ command.response_representation = Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse::Representation
293
+ command.response_class = Google::Apis::StreetviewpublishV1::BatchDeletePhotosResponse
294
+ command.query['fields'] = fields unless fields.nil?
295
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
296
+ execute_or_queue_command(command, &block)
297
+ end
298
+
299
+ # Gets the metadata of the specified Photo batch. Note that if BatchGetPhotos
300
+ # fails, either critical fields are missing or there is an authentication error.
301
+ # Even if BatchGetPhotos succeeds, individual photos in the batch may have
302
+ # failures. These failures are specified in each PhotoResponse.status in
303
+ # BatchGetPhotosResponse.results. See GetPhoto for specific failures that can
304
+ # occur per photo.
305
+ # @param [String] language_code
306
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information,
307
+ # see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If
308
+ # language_code is unspecified, the user's language preference for Google
309
+ # services is used.
310
+ # @param [Array<String>, String] photo_ids
311
+ # Required. IDs of the Photos. For HTTP GET requests, the URL query parameter
312
+ # should be `photoIds=&photoIds=&...`.
313
+ # @param [String] view
314
+ # Required. Specifies if a download URL for the photo bytes should be returned
315
+ # in the Photo response.
316
+ # @param [String] fields
317
+ # Selector specifying which fields to include in a partial response.
318
+ # @param [String] quota_user
319
+ # Available to use for quota purposes for server-side applications. Can be any
320
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
321
+ # @param [Google::Apis::RequestOptions] options
322
+ # Request-specific options
323
+ #
324
+ # @yield [result, err] Result & error if block supplied
325
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse] parsed result object
326
+ # @yieldparam err [StandardError] error object if request failed
327
+ #
328
+ # @return [Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse]
329
+ #
330
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
331
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
332
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
333
+ def batch_photo_get(language_code: nil, photo_ids: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
334
+ command = make_simple_command(:get, 'v1/photos:batchGet', options)
335
+ command.response_representation = Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse::Representation
336
+ command.response_class = Google::Apis::StreetviewpublishV1::BatchGetPhotosResponse
337
+ command.query['languageCode'] = language_code unless language_code.nil?
338
+ command.query['photoIds'] = photo_ids unless photo_ids.nil?
339
+ command.query['view'] = view unless view.nil?
340
+ command.query['fields'] = fields unless fields.nil?
341
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
342
+ execute_or_queue_command(command, &block)
343
+ end
344
+
345
+ # Updates the metadata of Photos, such as pose, place association, connections,
346
+ # etc. Changing the pixels of photos is not supported. Note that if
347
+ # BatchUpdatePhotos fails, either critical fields are missing or there is an
348
+ # authentication error. Even if BatchUpdatePhotos succeeds, individual photos in
349
+ # the batch may have failures. These failures are specified in each
350
+ # PhotoResponse.status in BatchUpdatePhotosResponse.results. See UpdatePhoto for
351
+ # specific failures that can occur per photo. Only the fields specified in
352
+ # updateMask field are used. If `updateMask` is not present, the update applies
353
+ # to all fields. The number of UpdatePhotoRequest messages in a
354
+ # BatchUpdatePhotosRequest must not exceed 20. *Note:* To update Pose.altitude,
355
+ # Pose.latLngPair has to be filled as well. Otherwise, the request will fail.
356
+ # @param [Google::Apis::StreetviewpublishV1::BatchUpdatePhotosRequest] batch_update_photos_request_object
357
+ # @param [String] fields
358
+ # Selector specifying which fields to include in a partial response.
359
+ # @param [String] quota_user
360
+ # Available to use for quota purposes for server-side applications. Can be any
361
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
362
+ # @param [Google::Apis::RequestOptions] options
363
+ # Request-specific options
364
+ #
365
+ # @yield [result, err] Result & error if block supplied
366
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse] parsed result object
367
+ # @yieldparam err [StandardError] error object if request failed
368
+ #
369
+ # @return [Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse]
370
+ #
371
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
372
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
373
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
374
+ def batch_update_photos(batch_update_photos_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
375
+ command = make_simple_command(:post, 'v1/photos:batchUpdate', options)
376
+ command.request_representation = Google::Apis::StreetviewpublishV1::BatchUpdatePhotosRequest::Representation
377
+ command.request_object = batch_update_photos_request_object
378
+ command.response_representation = Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse::Representation
379
+ command.response_class = Google::Apis::StreetviewpublishV1::BatchUpdatePhotosResponse
380
+ command.query['fields'] = fields unless fields.nil?
381
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
382
+ execute_or_queue_command(command, &block)
383
+ end
384
+
385
+ # Lists all the Photos that belong to the user. *Note:* Recently created photos
386
+ # that are still being indexed are not returned in the response.
387
+ # @param [String] filter
388
+ # Required. The filter expression. For example: `placeId=
389
+ # ChIJj61dQgK6j4AR4GeTYWZsKWw`. The only filter supported at the moment is `
390
+ # placeId`.
391
+ # @param [String] language_code
392
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information,
393
+ # see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If
394
+ # language_code is unspecified, the user's language preference for Google
395
+ # services is used.
396
+ # @param [Fixnum] page_size
397
+ # The maximum number of photos to return. `pageSize` must be non-negative. If `
398
+ # pageSize` is zero or is not provided, the default page size of 100 is used.
399
+ # The number of photos returned in the response may be less than `pageSize` if
400
+ # the number of photos that belong to the user is less than `pageSize`.
401
+ # @param [String] page_token
402
+ # The nextPageToken value returned from a previous ListPhotos request, if any.
403
+ # @param [String] view
404
+ # Required. Specifies if a download URL for the photos bytes should be returned
405
+ # in the Photos response.
406
+ # @param [String] fields
407
+ # Selector specifying which fields to include in a partial response.
408
+ # @param [String] quota_user
409
+ # Available to use for quota purposes for server-side applications. Can be any
410
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
411
+ # @param [Google::Apis::RequestOptions] options
412
+ # Request-specific options
413
+ #
414
+ # @yield [result, err] Result & error if block supplied
415
+ # @yieldparam result [Google::Apis::StreetviewpublishV1::ListPhotosResponse] parsed result object
416
+ # @yieldparam err [StandardError] error object if request failed
417
+ #
418
+ # @return [Google::Apis::StreetviewpublishV1::ListPhotosResponse]
419
+ #
420
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
421
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
422
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
423
+ def list_photos(filter: nil, language_code: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
424
+ command = make_simple_command(:get, 'v1/photos', options)
425
+ command.response_representation = Google::Apis::StreetviewpublishV1::ListPhotosResponse::Representation
426
+ command.response_class = Google::Apis::StreetviewpublishV1::ListPhotosResponse
427
+ command.query['filter'] = filter unless filter.nil?
428
+ command.query['languageCode'] = language_code unless language_code.nil?
429
+ command.query['pageSize'] = page_size unless page_size.nil?
430
+ command.query['pageToken'] = page_token unless page_token.nil?
431
+ command.query['view'] = view unless view.nil?
432
+ command.query['fields'] = fields unless fields.nil?
433
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
434
+ execute_or_queue_command(command, &block)
435
+ end
436
+
437
+ protected
438
+
439
+ def apply_command_defaults(command)
440
+ command.query['key'] = key unless key.nil?
441
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
442
+ end
443
+ end
444
+ end
445
+ end
446
+ end