OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis.streetviewpublish.v1; |
| 4 |
| 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; |
| 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; |
| 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 13 ApiRequestError, DetailedApiRequestError; |
| 14 |
| 15 const core.String USER_AGENT = 'dart-api-client streetviewpublish/v1'; |
| 16 |
| 17 /** |
| 18 * Publishes 360 photos to Google Maps, along with position, orientation, and |
| 19 * connectivity metadata. Apps can offer an interface for positioning, |
| 20 * connecting, and uploading user-generated Street View images. |
| 21 */ |
| 22 class StreetviewpublishApi { |
| 23 /** Publish and manage your 360 photos on Google Street View */ |
| 24 static const StreetviewpublishScope = "https://www.googleapis.com/auth/streetv
iewpublish"; |
| 25 |
| 26 |
| 27 final commons.ApiRequester _requester; |
| 28 |
| 29 PhotoResourceApi get photo => new PhotoResourceApi(_requester); |
| 30 PhotosResourceApi get photos => new PhotosResourceApi(_requester); |
| 31 |
| 32 StreetviewpublishApi(http.Client client, {core.String rootUrl: "https://street
viewpublish.googleapis.com/", core.String servicePath: ""}) : |
| 33 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 34 } |
| 35 |
| 36 |
| 37 class PhotoResourceApi { |
| 38 final commons.ApiRequester _requester; |
| 39 |
| 40 PhotoResourceApi(commons.ApiRequester client) : |
| 41 _requester = client; |
| 42 |
| 43 /** |
| 44 * After the client finishes uploading the photo with the returned |
| 45 * UploadRef, |
| 46 * CreatePhoto |
| 47 * publishes the uploaded Photo to |
| 48 * Street View on Google Maps. |
| 49 * |
| 50 * This method returns the following error codes: |
| 51 * |
| 52 * * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. |
| 53 * * google.rpc.Code.NOT_FOUND if the upload reference does not exist. |
| 54 * * google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the |
| 55 * storage limit. |
| 56 * |
| 57 * [request] - The metadata request object. |
| 58 * |
| 59 * Request parameters: |
| 60 * |
| 61 * Completes with a [Photo]. |
| 62 * |
| 63 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 64 * error. |
| 65 * |
| 66 * If the used [http.Client] completes with an error when making a REST call, |
| 67 * this method will complete with the same error. |
| 68 */ |
| 69 async.Future<Photo> create(Photo request) { |
| 70 var _url = null; |
| 71 var _queryParams = new core.Map(); |
| 72 var _uploadMedia = null; |
| 73 var _uploadOptions = null; |
| 74 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 75 var _body = null; |
| 76 |
| 77 if (request != null) { |
| 78 _body = convert.JSON.encode((request).toJson()); |
| 79 } |
| 80 |
| 81 _url = 'v1/photo'; |
| 82 |
| 83 var _response = _requester.request(_url, |
| 84 "POST", |
| 85 body: _body, |
| 86 queryParams: _queryParams, |
| 87 uploadOptions: _uploadOptions, |
| 88 uploadMedia: _uploadMedia, |
| 89 downloadOptions: _downloadOptions); |
| 90 return _response.then((data) => new Photo.fromJson(data)); |
| 91 } |
| 92 |
| 93 /** |
| 94 * Deletes a Photo and its metadata. |
| 95 * |
| 96 * This method returns the following error codes: |
| 97 * |
| 98 * * google.rpc.Code.PERMISSION_DENIED if the requesting user did not |
| 99 * create the requested photo. |
| 100 * * google.rpc.Code.NOT_FOUND if the photo ID does not exist. |
| 101 * |
| 102 * Request parameters: |
| 103 * |
| 104 * [photoId] - Required. ID of the Photo. |
| 105 * |
| 106 * Completes with a [Empty]. |
| 107 * |
| 108 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 109 * error. |
| 110 * |
| 111 * If the used [http.Client] completes with an error when making a REST call, |
| 112 * this method will complete with the same error. |
| 113 */ |
| 114 async.Future<Empty> delete(core.String photoId) { |
| 115 var _url = null; |
| 116 var _queryParams = new core.Map(); |
| 117 var _uploadMedia = null; |
| 118 var _uploadOptions = null; |
| 119 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 120 var _body = null; |
| 121 |
| 122 if (photoId == null) { |
| 123 throw new core.ArgumentError("Parameter photoId is required."); |
| 124 } |
| 125 |
| 126 _url = 'v1/photo/' + commons.Escaper.ecapeVariable('$photoId'); |
| 127 |
| 128 var _response = _requester.request(_url, |
| 129 "DELETE", |
| 130 body: _body, |
| 131 queryParams: _queryParams, |
| 132 uploadOptions: _uploadOptions, |
| 133 uploadMedia: _uploadMedia, |
| 134 downloadOptions: _downloadOptions); |
| 135 return _response.then((data) => new Empty.fromJson(data)); |
| 136 } |
| 137 |
| 138 /** |
| 139 * Gets the metadata of the specified |
| 140 * Photo. |
| 141 * |
| 142 * This method returns the following error codes: |
| 143 * |
| 144 * * google.rpc.Code.PERMISSION_DENIED if the requesting user did not |
| 145 * create the requested Photo. |
| 146 * * google.rpc.Code.NOT_FOUND if the requested |
| 147 * Photo does not exist. |
| 148 * |
| 149 * Request parameters: |
| 150 * |
| 151 * [photoId] - Required. ID of the Photo. |
| 152 * |
| 153 * [view] - Specifies if a download URL for the photo bytes should be returned |
| 154 * in the |
| 155 * Photo response. |
| 156 * Possible string values are: |
| 157 * - "BASIC" : A BASIC. |
| 158 * - "INCLUDE_DOWNLOAD_URL" : A INCLUDE_DOWNLOAD_URL. |
| 159 * |
| 160 * Completes with a [Photo]. |
| 161 * |
| 162 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 163 * error. |
| 164 * |
| 165 * If the used [http.Client] completes with an error when making a REST call, |
| 166 * this method will complete with the same error. |
| 167 */ |
| 168 async.Future<Photo> get(core.String photoId, {core.String view}) { |
| 169 var _url = null; |
| 170 var _queryParams = new core.Map(); |
| 171 var _uploadMedia = null; |
| 172 var _uploadOptions = null; |
| 173 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 174 var _body = null; |
| 175 |
| 176 if (photoId == null) { |
| 177 throw new core.ArgumentError("Parameter photoId is required."); |
| 178 } |
| 179 if (view != null) { |
| 180 _queryParams["view"] = [view]; |
| 181 } |
| 182 |
| 183 _url = 'v1/photo/' + commons.Escaper.ecapeVariable('$photoId'); |
| 184 |
| 185 var _response = _requester.request(_url, |
| 186 "GET", |
| 187 body: _body, |
| 188 queryParams: _queryParams, |
| 189 uploadOptions: _uploadOptions, |
| 190 uploadMedia: _uploadMedia, |
| 191 downloadOptions: _downloadOptions); |
| 192 return _response.then((data) => new Photo.fromJson(data)); |
| 193 } |
| 194 |
| 195 /** |
| 196 * Creates an upload session to start uploading photo bytes. The upload URL of |
| 197 * the returned UploadRef is used to |
| 198 * upload the bytes for the Photo. |
| 199 * |
| 200 * In addition to the photo requirements shown in |
| 201 * https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, |
| 202 * the photo must also meet the following requirements: |
| 203 * |
| 204 * * Photo Sphere XMP metadata must be included in the photo medadata. See |
| 205 * https://developers.google.com/streetview/spherical-metadata for the |
| 206 * required fields. |
| 207 * * The pixel size of the photo must meet the size requirements listed in |
| 208 * https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and |
| 209 * the photo must be a full 360 horizontally. |
| 210 * |
| 211 * After the upload is complete, the |
| 212 * UploadRef is used with |
| 213 * CreatePhoto |
| 214 * to create the Photo object entry. |
| 215 * |
| 216 * [request] - The metadata request object. |
| 217 * |
| 218 * Request parameters: |
| 219 * |
| 220 * Completes with a [UploadRef]. |
| 221 * |
| 222 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 223 * error. |
| 224 * |
| 225 * If the used [http.Client] completes with an error when making a REST call, |
| 226 * this method will complete with the same error. |
| 227 */ |
| 228 async.Future<UploadRef> startUpload(Empty request) { |
| 229 var _url = null; |
| 230 var _queryParams = new core.Map(); |
| 231 var _uploadMedia = null; |
| 232 var _uploadOptions = null; |
| 233 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 234 var _body = null; |
| 235 |
| 236 if (request != null) { |
| 237 _body = convert.JSON.encode((request).toJson()); |
| 238 } |
| 239 |
| 240 _url = 'v1/photo:startUpload'; |
| 241 |
| 242 var _response = _requester.request(_url, |
| 243 "POST", |
| 244 body: _body, |
| 245 queryParams: _queryParams, |
| 246 uploadOptions: _uploadOptions, |
| 247 uploadMedia: _uploadMedia, |
| 248 downloadOptions: _downloadOptions); |
| 249 return _response.then((data) => new UploadRef.fromJson(data)); |
| 250 } |
| 251 |
| 252 /** |
| 253 * Updates the metadata of a Photo, such |
| 254 * as pose, place association, connections, etc. Changing the pixels of a |
| 255 * photo is not supported. |
| 256 * |
| 257 * This method returns the following error codes: |
| 258 * |
| 259 * * google.rpc.Code.PERMISSION_DENIED if the requesting user did not |
| 260 * create the requested photo. |
| 261 * * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. |
| 262 * * google.rpc.Code.NOT_FOUND if the requested photo does not exist. |
| 263 * |
| 264 * [request] - The metadata request object. |
| 265 * |
| 266 * Request parameters: |
| 267 * |
| 268 * [id] - Required. A base64 encoded identifier. |
| 269 * |
| 270 * [updateMask] - Mask that identifies fields on the photo metadata to update. |
| 271 * If not present, the old Photo metadata will be entirely replaced with the |
| 272 * new Photo metadata in this request. The update fails if invalid fields are |
| 273 * specified. Multiple fields can be specified in a comma-delimited list. |
| 274 * |
| 275 * The following fields are valid: |
| 276 * |
| 277 * * `pose.heading` |
| 278 * * `pose.latlngpair` |
| 279 * * `pose.pitch` |
| 280 * * `pose.roll` |
| 281 * * `pose.level` |
| 282 * * `pose.altitude` |
| 283 * * `connections` |
| 284 * * `places` |
| 285 * |
| 286 * |
| 287 * <aside class="note"><b>Note:</b> Repeated fields in |
| 288 * updateMask |
| 289 * mean the entire set of repeated values will be replaced with the new |
| 290 * contents. For example, if |
| 291 * updateMask |
| 292 * contains `connections` and |
| 293 * google.streetview.publish.v1.UpdatePhotoRequest.photo.connections is |
| 294 * empty, all connections will be removed.</aside> |
| 295 * |
| 296 * Completes with a [Photo]. |
| 297 * |
| 298 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 299 * error. |
| 300 * |
| 301 * If the used [http.Client] completes with an error when making a REST call, |
| 302 * this method will complete with the same error. |
| 303 */ |
| 304 async.Future<Photo> update(Photo request, core.String id, {core.String updateM
ask}) { |
| 305 var _url = null; |
| 306 var _queryParams = new core.Map(); |
| 307 var _uploadMedia = null; |
| 308 var _uploadOptions = null; |
| 309 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 310 var _body = null; |
| 311 |
| 312 if (request != null) { |
| 313 _body = convert.JSON.encode((request).toJson()); |
| 314 } |
| 315 if (id == null) { |
| 316 throw new core.ArgumentError("Parameter id is required."); |
| 317 } |
| 318 if (updateMask != null) { |
| 319 _queryParams["updateMask"] = [updateMask]; |
| 320 } |
| 321 |
| 322 _url = 'v1/photo/' + commons.Escaper.ecapeVariable('$id'); |
| 323 |
| 324 var _response = _requester.request(_url, |
| 325 "PUT", |
| 326 body: _body, |
| 327 queryParams: _queryParams, |
| 328 uploadOptions: _uploadOptions, |
| 329 uploadMedia: _uploadMedia, |
| 330 downloadOptions: _downloadOptions); |
| 331 return _response.then((data) => new Photo.fromJson(data)); |
| 332 } |
| 333 |
| 334 } |
| 335 |
| 336 |
| 337 class PhotosResourceApi { |
| 338 final commons.ApiRequester _requester; |
| 339 |
| 340 PhotosResourceApi(commons.ApiRequester client) : |
| 341 _requester = client; |
| 342 |
| 343 /** |
| 344 * Deletes a list of Photos and their metadata. |
| 345 * |
| 346 * Note that if |
| 347 * BatchDeletePhotos |
| 348 * fails, either critical fields are missing or there was an authentication |
| 349 * error. Even if |
| 350 * BatchDeletePhotos |
| 351 * succeeds, there may have been failures for single photos in the batch. |
| 352 * These failures will be specified in each |
| 353 * PhotoResponse.status |
| 354 * in |
| 355 * BatchDeletePhotosResponse.results. |
| 356 * See |
| 357 * DeletePhoto |
| 358 * for specific failures that can occur per photo. |
| 359 * |
| 360 * [request] - The metadata request object. |
| 361 * |
| 362 * Request parameters: |
| 363 * |
| 364 * Completes with a [BatchDeletePhotosResponse]. |
| 365 * |
| 366 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 367 * error. |
| 368 * |
| 369 * If the used [http.Client] completes with an error when making a REST call, |
| 370 * this method will complete with the same error. |
| 371 */ |
| 372 async.Future<BatchDeletePhotosResponse> batchDelete(BatchDeletePhotosRequest r
equest) { |
| 373 var _url = null; |
| 374 var _queryParams = new core.Map(); |
| 375 var _uploadMedia = null; |
| 376 var _uploadOptions = null; |
| 377 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 378 var _body = null; |
| 379 |
| 380 if (request != null) { |
| 381 _body = convert.JSON.encode((request).toJson()); |
| 382 } |
| 383 |
| 384 _url = 'v1/photos:batchDelete'; |
| 385 |
| 386 var _response = _requester.request(_url, |
| 387 "POST", |
| 388 body: _body, |
| 389 queryParams: _queryParams, |
| 390 uploadOptions: _uploadOptions, |
| 391 uploadMedia: _uploadMedia, |
| 392 downloadOptions: _downloadOptions); |
| 393 return _response.then((data) => new BatchDeletePhotosResponse.fromJson(data)
); |
| 394 } |
| 395 |
| 396 /** |
| 397 * Gets the metadata of the specified |
| 398 * Photo batch. |
| 399 * |
| 400 * Note that if |
| 401 * BatchGetPhotos |
| 402 * fails, either critical fields are missing or there was an authentication |
| 403 * error. Even if |
| 404 * BatchGetPhotos |
| 405 * succeeds, there may have been failures for single photos in the batch. |
| 406 * These failures will be specified in each |
| 407 * PhotoResponse.status |
| 408 * in |
| 409 * BatchGetPhotosResponse.results. |
| 410 * See |
| 411 * GetPhoto |
| 412 * for specific failures that can occur per photo. |
| 413 * |
| 414 * Request parameters: |
| 415 * |
| 416 * [view] - Specifies if a download URL for the photo bytes should be returned |
| 417 * in the |
| 418 * Photo response. |
| 419 * Possible string values are: |
| 420 * - "BASIC" : A BASIC. |
| 421 * - "INCLUDE_DOWNLOAD_URL" : A INCLUDE_DOWNLOAD_URL. |
| 422 * |
| 423 * [photoIds] - Required. IDs of the Photos. For HTTP |
| 424 * GET requests, the URL query parameter should be |
| 425 * `photoIds=<id1>&photoIds=<id2>&...`. |
| 426 * |
| 427 * Completes with a [BatchGetPhotosResponse]. |
| 428 * |
| 429 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 430 * error. |
| 431 * |
| 432 * If the used [http.Client] completes with an error when making a REST call, |
| 433 * this method will complete with the same error. |
| 434 */ |
| 435 async.Future<BatchGetPhotosResponse> batchGet({core.String view, core.List<cor
e.String> photoIds}) { |
| 436 var _url = null; |
| 437 var _queryParams = new core.Map(); |
| 438 var _uploadMedia = null; |
| 439 var _uploadOptions = null; |
| 440 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 441 var _body = null; |
| 442 |
| 443 if (view != null) { |
| 444 _queryParams["view"] = [view]; |
| 445 } |
| 446 if (photoIds != null) { |
| 447 _queryParams["photoIds"] = photoIds; |
| 448 } |
| 449 |
| 450 _url = 'v1/photos:batchGet'; |
| 451 |
| 452 var _response = _requester.request(_url, |
| 453 "GET", |
| 454 body: _body, |
| 455 queryParams: _queryParams, |
| 456 uploadOptions: _uploadOptions, |
| 457 uploadMedia: _uploadMedia, |
| 458 downloadOptions: _downloadOptions); |
| 459 return _response.then((data) => new BatchGetPhotosResponse.fromJson(data)); |
| 460 } |
| 461 |
| 462 /** |
| 463 * Updates the metadata of Photos, such |
| 464 * as pose, place association, connections, etc. Changing the pixels of photos |
| 465 * is not supported. |
| 466 * |
| 467 * Note that if |
| 468 * BatchUpdatePhotos |
| 469 * fails, either critical fields are missing or there was an authentication |
| 470 * error. Even if |
| 471 * BatchUpdatePhotos |
| 472 * succeeds, there may have been failures for single photos in the batch. |
| 473 * These failures will be specified in each |
| 474 * PhotoResponse.status |
| 475 * in |
| 476 * BatchUpdatePhotosResponse.results. |
| 477 * See |
| 478 * UpdatePhoto |
| 479 * for specific failures that can occur per photo. |
| 480 * |
| 481 * [request] - The metadata request object. |
| 482 * |
| 483 * Request parameters: |
| 484 * |
| 485 * Completes with a [BatchUpdatePhotosResponse]. |
| 486 * |
| 487 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 488 * error. |
| 489 * |
| 490 * If the used [http.Client] completes with an error when making a REST call, |
| 491 * this method will complete with the same error. |
| 492 */ |
| 493 async.Future<BatchUpdatePhotosResponse> batchUpdate(BatchUpdatePhotosRequest r
equest) { |
| 494 var _url = null; |
| 495 var _queryParams = new core.Map(); |
| 496 var _uploadMedia = null; |
| 497 var _uploadOptions = null; |
| 498 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 499 var _body = null; |
| 500 |
| 501 if (request != null) { |
| 502 _body = convert.JSON.encode((request).toJson()); |
| 503 } |
| 504 |
| 505 _url = 'v1/photos:batchUpdate'; |
| 506 |
| 507 var _response = _requester.request(_url, |
| 508 "POST", |
| 509 body: _body, |
| 510 queryParams: _queryParams, |
| 511 uploadOptions: _uploadOptions, |
| 512 uploadMedia: _uploadMedia, |
| 513 downloadOptions: _downloadOptions); |
| 514 return _response.then((data) => new BatchUpdatePhotosResponse.fromJson(data)
); |
| 515 } |
| 516 |
| 517 /** |
| 518 * Lists all the Photos that belong to the user. |
| 519 * |
| 520 * Request parameters: |
| 521 * |
| 522 * [pageToken] - The |
| 523 * nextPageToken |
| 524 * value returned from a previous |
| 525 * ListPhotos |
| 526 * request, if any. |
| 527 * |
| 528 * [pageSize] - The maximum number of photos to return. |
| 529 * `pageSize` must be non-negative. If `pageSize` is zero or is not provided, |
| 530 * the default page size of 100 will be used. |
| 531 * The number of photos returned in the response may be less than `pageSize` |
| 532 * if the number of photos that belong to the user is less than `pageSize`. |
| 533 * |
| 534 * [view] - Specifies if a download URL for the photos bytes should be |
| 535 * returned in the |
| 536 * Photos response. |
| 537 * Possible string values are: |
| 538 * - "BASIC" : A BASIC. |
| 539 * - "INCLUDE_DOWNLOAD_URL" : A INCLUDE_DOWNLOAD_URL. |
| 540 * |
| 541 * [filter] - The filter expression. For example: |
| 542 * `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`. |
| 543 * |
| 544 * Completes with a [ListPhotosResponse]. |
| 545 * |
| 546 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 547 * error. |
| 548 * |
| 549 * If the used [http.Client] completes with an error when making a REST call, |
| 550 * this method will complete with the same error. |
| 551 */ |
| 552 async.Future<ListPhotosResponse> list({core.String pageToken, core.int pageSiz
e, core.String view, core.String filter}) { |
| 553 var _url = null; |
| 554 var _queryParams = new core.Map(); |
| 555 var _uploadMedia = null; |
| 556 var _uploadOptions = null; |
| 557 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 558 var _body = null; |
| 559 |
| 560 if (pageToken != null) { |
| 561 _queryParams["pageToken"] = [pageToken]; |
| 562 } |
| 563 if (pageSize != null) { |
| 564 _queryParams["pageSize"] = ["${pageSize}"]; |
| 565 } |
| 566 if (view != null) { |
| 567 _queryParams["view"] = [view]; |
| 568 } |
| 569 if (filter != null) { |
| 570 _queryParams["filter"] = [filter]; |
| 571 } |
| 572 |
| 573 _url = 'v1/photos'; |
| 574 |
| 575 var _response = _requester.request(_url, |
| 576 "GET", |
| 577 body: _body, |
| 578 queryParams: _queryParams, |
| 579 uploadOptions: _uploadOptions, |
| 580 uploadMedia: _uploadMedia, |
| 581 downloadOptions: _downloadOptions); |
| 582 return _response.then((data) => new ListPhotosResponse.fromJson(data)); |
| 583 } |
| 584 |
| 585 } |
| 586 |
| 587 |
| 588 |
| 589 /** Request to delete multiple Photos. */ |
| 590 class BatchDeletePhotosRequest { |
| 591 /** |
| 592 * Required. IDs of the Photos. For HTTP |
| 593 * GET requests, the URL query parameter should be |
| 594 * `photoIds=<id1>&photoIds=<id2>&...`. |
| 595 */ |
| 596 core.List<core.String> photoIds; |
| 597 |
| 598 BatchDeletePhotosRequest(); |
| 599 |
| 600 BatchDeletePhotosRequest.fromJson(core.Map _json) { |
| 601 if (_json.containsKey("photoIds")) { |
| 602 photoIds = _json["photoIds"]; |
| 603 } |
| 604 } |
| 605 |
| 606 core.Map<core.String, core.Object> toJson() { |
| 607 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 608 if (photoIds != null) { |
| 609 _json["photoIds"] = photoIds; |
| 610 } |
| 611 return _json; |
| 612 } |
| 613 } |
| 614 |
| 615 /** |
| 616 * Response to batch delete of one or more |
| 617 * Photos. |
| 618 */ |
| 619 class BatchDeletePhotosResponse { |
| 620 /** |
| 621 * The status for the operation to delete a single |
| 622 * Photo in the batch request. |
| 623 */ |
| 624 core.List<Status> status; |
| 625 |
| 626 BatchDeletePhotosResponse(); |
| 627 |
| 628 BatchDeletePhotosResponse.fromJson(core.Map _json) { |
| 629 if (_json.containsKey("status")) { |
| 630 status = _json["status"].map((value) => new Status.fromJson(value)).toList
(); |
| 631 } |
| 632 } |
| 633 |
| 634 core.Map<core.String, core.Object> toJson() { |
| 635 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 636 if (status != null) { |
| 637 _json["status"] = status.map((value) => (value).toJson()).toList(); |
| 638 } |
| 639 return _json; |
| 640 } |
| 641 } |
| 642 |
| 643 /** Response to batch get of Photos. */ |
| 644 class BatchGetPhotosResponse { |
| 645 /** |
| 646 * List of results for each individual |
| 647 * Photo requested, in the same order as |
| 648 * the requests in |
| 649 * BatchGetPhotos. |
| 650 */ |
| 651 core.List<PhotoResponse> results; |
| 652 |
| 653 BatchGetPhotosResponse(); |
| 654 |
| 655 BatchGetPhotosResponse.fromJson(core.Map _json) { |
| 656 if (_json.containsKey("results")) { |
| 657 results = _json["results"].map((value) => new PhotoResponse.fromJson(value
)).toList(); |
| 658 } |
| 659 } |
| 660 |
| 661 core.Map<core.String, core.Object> toJson() { |
| 662 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 663 if (results != null) { |
| 664 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 665 } |
| 666 return _json; |
| 667 } |
| 668 } |
| 669 |
| 670 /** |
| 671 * Request to update the metadata of photos. |
| 672 * Updating the pixels of photos is not supported. |
| 673 */ |
| 674 class BatchUpdatePhotosRequest { |
| 675 /** |
| 676 * Required. List of |
| 677 * UpdatePhotoRequests. |
| 678 */ |
| 679 core.List<UpdatePhotoRequest> updatePhotoRequests; |
| 680 |
| 681 BatchUpdatePhotosRequest(); |
| 682 |
| 683 BatchUpdatePhotosRequest.fromJson(core.Map _json) { |
| 684 if (_json.containsKey("updatePhotoRequests")) { |
| 685 updatePhotoRequests = _json["updatePhotoRequests"].map((value) => new Upda
tePhotoRequest.fromJson(value)).toList(); |
| 686 } |
| 687 } |
| 688 |
| 689 core.Map<core.String, core.Object> toJson() { |
| 690 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 691 if (updatePhotoRequests != null) { |
| 692 _json["updatePhotoRequests"] = updatePhotoRequests.map((value) => (value).
toJson()).toList(); |
| 693 } |
| 694 return _json; |
| 695 } |
| 696 } |
| 697 |
| 698 /** |
| 699 * Response to batch update of metadata of one or more |
| 700 * Photos. |
| 701 */ |
| 702 class BatchUpdatePhotosResponse { |
| 703 /** |
| 704 * List of results for each individual |
| 705 * Photo updated, in the same order as |
| 706 * the request. |
| 707 */ |
| 708 core.List<PhotoResponse> results; |
| 709 |
| 710 BatchUpdatePhotosResponse(); |
| 711 |
| 712 BatchUpdatePhotosResponse.fromJson(core.Map _json) { |
| 713 if (_json.containsKey("results")) { |
| 714 results = _json["results"].map((value) => new PhotoResponse.fromJson(value
)).toList(); |
| 715 } |
| 716 } |
| 717 |
| 718 core.Map<core.String, core.Object> toJson() { |
| 719 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 720 if (results != null) { |
| 721 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 722 } |
| 723 return _json; |
| 724 } |
| 725 } |
| 726 |
| 727 /** A connection is the link from a source photo to a destination photo. */ |
| 728 class Connection { |
| 729 /** |
| 730 * Required. The destination of the connection from the containing photo to |
| 731 * another photo. |
| 732 */ |
| 733 PhotoId target; |
| 734 |
| 735 Connection(); |
| 736 |
| 737 Connection.fromJson(core.Map _json) { |
| 738 if (_json.containsKey("target")) { |
| 739 target = new PhotoId.fromJson(_json["target"]); |
| 740 } |
| 741 } |
| 742 |
| 743 core.Map<core.String, core.Object> toJson() { |
| 744 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 745 if (target != null) { |
| 746 _json["target"] = (target).toJson(); |
| 747 } |
| 748 return _json; |
| 749 } |
| 750 } |
| 751 |
| 752 /** |
| 753 * A generic empty message that you can re-use to avoid defining duplicated |
| 754 * empty messages in your APIs. A typical example is to use it as the request |
| 755 * or the response type of an API method. For instance: |
| 756 * |
| 757 * service Foo { |
| 758 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 759 * } |
| 760 * |
| 761 * The JSON representation for `Empty` is empty JSON object `{}`. |
| 762 */ |
| 763 class Empty { |
| 764 |
| 765 Empty(); |
| 766 |
| 767 Empty.fromJson(core.Map _json) { |
| 768 } |
| 769 |
| 770 core.Map<core.String, core.Object> toJson() { |
| 771 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 772 return _json; |
| 773 } |
| 774 } |
| 775 |
| 776 /** |
| 777 * An object representing a latitude/longitude pair. This is expressed as a pair |
| 778 * of doubles representing degrees latitude and degrees longitude. Unless |
| 779 * specified otherwise, this must conform to the |
| 780 * <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 |
| 781 * standard</a>. Values must be within normalized ranges. |
| 782 * |
| 783 * Example of normalization code in Python: |
| 784 * |
| 785 * def NormalizeLongitude(longitude): |
| 786 * """Wraps decimal degrees longitude to [-180.0, 180.0].""" |
| 787 * q, r = divmod(longitude, 360.0) |
| 788 * if r > 180.0 or (r == 180.0 and q <= -1.0): |
| 789 * return r - 360.0 |
| 790 * return r |
| 791 * |
| 792 * def NormalizeLatLng(latitude, longitude): |
| 793 * """Wraps decimal degrees latitude and longitude to |
| 794 * [-90.0, 90.0] and [-180.0, 180.0], respectively.""" |
| 795 * r = latitude % 360.0 |
| 796 * if r <= 90.0: |
| 797 * return r, NormalizeLongitude(longitude) |
| 798 * elif r >= 270.0: |
| 799 * return r - 360, NormalizeLongitude(longitude) |
| 800 * else: |
| 801 * return 180 - r, NormalizeLongitude(longitude + 180.0) |
| 802 * |
| 803 * assert 180.0 == NormalizeLongitude(180.0) |
| 804 * assert -180.0 == NormalizeLongitude(-180.0) |
| 805 * assert -179.0 == NormalizeLongitude(181.0) |
| 806 * assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) |
| 807 * assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) |
| 808 * assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) |
| 809 * assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) |
| 810 * assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) |
| 811 * assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) |
| 812 * assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) |
| 813 * assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) |
| 814 * assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) |
| 815 * assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) |
| 816 */ |
| 817 class LatLng { |
| 818 /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ |
| 819 core.double latitude; |
| 820 /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */ |
| 821 core.double longitude; |
| 822 |
| 823 LatLng(); |
| 824 |
| 825 LatLng.fromJson(core.Map _json) { |
| 826 if (_json.containsKey("latitude")) { |
| 827 latitude = _json["latitude"]; |
| 828 } |
| 829 if (_json.containsKey("longitude")) { |
| 830 longitude = _json["longitude"]; |
| 831 } |
| 832 } |
| 833 |
| 834 core.Map<core.String, core.Object> toJson() { |
| 835 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 836 if (latitude != null) { |
| 837 _json["latitude"] = latitude; |
| 838 } |
| 839 if (longitude != null) { |
| 840 _json["longitude"] = longitude; |
| 841 } |
| 842 return _json; |
| 843 } |
| 844 } |
| 845 |
| 846 /** Level information containing level number and its corresponding name. */ |
| 847 class Level { |
| 848 /** |
| 849 * Required. A name assigned to this Level, restricted to 3 characters. |
| 850 * Consider how the elevator buttons would be labeled for this level if there |
| 851 * was an elevator. |
| 852 */ |
| 853 core.String name; |
| 854 /** |
| 855 * Floor number, used for ordering. 0 indicates the ground level, 1 indicates |
| 856 * the first level above ground level, -1 indicates the first level under |
| 857 * ground level. Non-integer values are OK. |
| 858 */ |
| 859 core.double number; |
| 860 |
| 861 Level(); |
| 862 |
| 863 Level.fromJson(core.Map _json) { |
| 864 if (_json.containsKey("name")) { |
| 865 name = _json["name"]; |
| 866 } |
| 867 if (_json.containsKey("number")) { |
| 868 number = _json["number"]; |
| 869 } |
| 870 } |
| 871 |
| 872 core.Map<core.String, core.Object> toJson() { |
| 873 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 874 if (name != null) { |
| 875 _json["name"] = name; |
| 876 } |
| 877 if (number != null) { |
| 878 _json["number"] = number; |
| 879 } |
| 880 return _json; |
| 881 } |
| 882 } |
| 883 |
| 884 /** Response to list all photos that belong to a user. */ |
| 885 class ListPhotosResponse { |
| 886 /** |
| 887 * Token to retrieve the next page of results, or empty if there are no more |
| 888 * results in the list. |
| 889 */ |
| 890 core.String nextPageToken; |
| 891 /** |
| 892 * List of photos. The maximum number of items returned is based on the |
| 893 * pageSize field |
| 894 * in the request. |
| 895 */ |
| 896 core.List<Photo> photos; |
| 897 |
| 898 ListPhotosResponse(); |
| 899 |
| 900 ListPhotosResponse.fromJson(core.Map _json) { |
| 901 if (_json.containsKey("nextPageToken")) { |
| 902 nextPageToken = _json["nextPageToken"]; |
| 903 } |
| 904 if (_json.containsKey("photos")) { |
| 905 photos = _json["photos"].map((value) => new Photo.fromJson(value)).toList(
); |
| 906 } |
| 907 } |
| 908 |
| 909 core.Map<core.String, core.Object> toJson() { |
| 910 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 911 if (nextPageToken != null) { |
| 912 _json["nextPageToken"] = nextPageToken; |
| 913 } |
| 914 if (photos != null) { |
| 915 _json["photos"] = photos.map((value) => (value).toJson()).toList(); |
| 916 } |
| 917 return _json; |
| 918 } |
| 919 } |
| 920 |
| 921 /** Photo is used to store 360 photos along with photo metadata. */ |
| 922 class Photo { |
| 923 /** |
| 924 * Absolute time when the photo was captured. |
| 925 * When the photo has no exif timestamp, this is used to set a timestamp in |
| 926 * the photo metadata. |
| 927 */ |
| 928 core.String captureTime; |
| 929 /** |
| 930 * Connections to other photos. A connection represents the link from this |
| 931 * photo to another photo. |
| 932 */ |
| 933 core.List<Connection> connections; |
| 934 /** |
| 935 * Output only. The download URL for the photo bytes. This field is set only |
| 936 * when |
| 937 * GetPhotoRequest.view |
| 938 * is set to |
| 939 * PhotoView.INCLUDE_DOWNLOAD_URL. |
| 940 */ |
| 941 core.String downloadUrl; |
| 942 /** |
| 943 * Required when updating photo. Output only when creating photo. |
| 944 * Identifier for the photo, which is unique among all photos in |
| 945 * Google. |
| 946 */ |
| 947 PhotoId photoId; |
| 948 /** Places where this photo belongs. */ |
| 949 core.List<Place> places; |
| 950 /** Pose of the photo. */ |
| 951 Pose pose; |
| 952 /** Output only. The share link for the photo. */ |
| 953 core.String shareLink; |
| 954 /** |
| 955 * Output only. The thumbnail URL for showing a preview of the given photo. |
| 956 */ |
| 957 core.String thumbnailUrl; |
| 958 /** |
| 959 * Required when creating photo. Input only. The resource URL where the photo |
| 960 * bytes are uploaded to. |
| 961 */ |
| 962 UploadRef uploadReference; |
| 963 /** Output only. View count of the photo. */ |
| 964 core.String viewCount; |
| 965 |
| 966 Photo(); |
| 967 |
| 968 Photo.fromJson(core.Map _json) { |
| 969 if (_json.containsKey("captureTime")) { |
| 970 captureTime = _json["captureTime"]; |
| 971 } |
| 972 if (_json.containsKey("connections")) { |
| 973 connections = _json["connections"].map((value) => new Connection.fromJson(
value)).toList(); |
| 974 } |
| 975 if (_json.containsKey("downloadUrl")) { |
| 976 downloadUrl = _json["downloadUrl"]; |
| 977 } |
| 978 if (_json.containsKey("photoId")) { |
| 979 photoId = new PhotoId.fromJson(_json["photoId"]); |
| 980 } |
| 981 if (_json.containsKey("places")) { |
| 982 places = _json["places"].map((value) => new Place.fromJson(value)).toList(
); |
| 983 } |
| 984 if (_json.containsKey("pose")) { |
| 985 pose = new Pose.fromJson(_json["pose"]); |
| 986 } |
| 987 if (_json.containsKey("shareLink")) { |
| 988 shareLink = _json["shareLink"]; |
| 989 } |
| 990 if (_json.containsKey("thumbnailUrl")) { |
| 991 thumbnailUrl = _json["thumbnailUrl"]; |
| 992 } |
| 993 if (_json.containsKey("uploadReference")) { |
| 994 uploadReference = new UploadRef.fromJson(_json["uploadReference"]); |
| 995 } |
| 996 if (_json.containsKey("viewCount")) { |
| 997 viewCount = _json["viewCount"]; |
| 998 } |
| 999 } |
| 1000 |
| 1001 core.Map<core.String, core.Object> toJson() { |
| 1002 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1003 if (captureTime != null) { |
| 1004 _json["captureTime"] = captureTime; |
| 1005 } |
| 1006 if (connections != null) { |
| 1007 _json["connections"] = connections.map((value) => (value).toJson()).toList
(); |
| 1008 } |
| 1009 if (downloadUrl != null) { |
| 1010 _json["downloadUrl"] = downloadUrl; |
| 1011 } |
| 1012 if (photoId != null) { |
| 1013 _json["photoId"] = (photoId).toJson(); |
| 1014 } |
| 1015 if (places != null) { |
| 1016 _json["places"] = places.map((value) => (value).toJson()).toList(); |
| 1017 } |
| 1018 if (pose != null) { |
| 1019 _json["pose"] = (pose).toJson(); |
| 1020 } |
| 1021 if (shareLink != null) { |
| 1022 _json["shareLink"] = shareLink; |
| 1023 } |
| 1024 if (thumbnailUrl != null) { |
| 1025 _json["thumbnailUrl"] = thumbnailUrl; |
| 1026 } |
| 1027 if (uploadReference != null) { |
| 1028 _json["uploadReference"] = (uploadReference).toJson(); |
| 1029 } |
| 1030 if (viewCount != null) { |
| 1031 _json["viewCount"] = viewCount; |
| 1032 } |
| 1033 return _json; |
| 1034 } |
| 1035 } |
| 1036 |
| 1037 /** Identifier for a Photo. */ |
| 1038 class PhotoId { |
| 1039 /** Required. A base64 encoded identifier. */ |
| 1040 core.String id; |
| 1041 |
| 1042 PhotoId(); |
| 1043 |
| 1044 PhotoId.fromJson(core.Map _json) { |
| 1045 if (_json.containsKey("id")) { |
| 1046 id = _json["id"]; |
| 1047 } |
| 1048 } |
| 1049 |
| 1050 core.Map<core.String, core.Object> toJson() { |
| 1051 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1052 if (id != null) { |
| 1053 _json["id"] = id; |
| 1054 } |
| 1055 return _json; |
| 1056 } |
| 1057 } |
| 1058 |
| 1059 /** |
| 1060 * Response payload for a single |
| 1061 * Photo |
| 1062 * in batch operations including |
| 1063 * BatchGetPhotos |
| 1064 * and |
| 1065 * BatchUpdatePhotos. |
| 1066 */ |
| 1067 class PhotoResponse { |
| 1068 /** |
| 1069 * The Photo resource, if the request |
| 1070 * was successful. |
| 1071 */ |
| 1072 Photo photo; |
| 1073 /** |
| 1074 * The status for the operation to get or update a single photo in the batch |
| 1075 * request. |
| 1076 */ |
| 1077 Status status; |
| 1078 |
| 1079 PhotoResponse(); |
| 1080 |
| 1081 PhotoResponse.fromJson(core.Map _json) { |
| 1082 if (_json.containsKey("photo")) { |
| 1083 photo = new Photo.fromJson(_json["photo"]); |
| 1084 } |
| 1085 if (_json.containsKey("status")) { |
| 1086 status = new Status.fromJson(_json["status"]); |
| 1087 } |
| 1088 } |
| 1089 |
| 1090 core.Map<core.String, core.Object> toJson() { |
| 1091 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1092 if (photo != null) { |
| 1093 _json["photo"] = (photo).toJson(); |
| 1094 } |
| 1095 if (status != null) { |
| 1096 _json["status"] = (status).toJson(); |
| 1097 } |
| 1098 return _json; |
| 1099 } |
| 1100 } |
| 1101 |
| 1102 /** Place metadata for an entity. */ |
| 1103 class Place { |
| 1104 /** |
| 1105 * Required. Place identifier, as described in |
| 1106 * https://developers.google.com/places/place-id. |
| 1107 */ |
| 1108 core.String placeId; |
| 1109 |
| 1110 Place(); |
| 1111 |
| 1112 Place.fromJson(core.Map _json) { |
| 1113 if (_json.containsKey("placeId")) { |
| 1114 placeId = _json["placeId"]; |
| 1115 } |
| 1116 } |
| 1117 |
| 1118 core.Map<core.String, core.Object> toJson() { |
| 1119 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1120 if (placeId != null) { |
| 1121 _json["placeId"] = placeId; |
| 1122 } |
| 1123 return _json; |
| 1124 } |
| 1125 } |
| 1126 |
| 1127 /** Raw pose measurement for an entity. */ |
| 1128 class Pose { |
| 1129 /** |
| 1130 * Altitude of the pose in meters above ground level (as defined by WGS84). |
| 1131 * NaN indicates an unmeasured quantity. |
| 1132 */ |
| 1133 core.double altitude; |
| 1134 /** |
| 1135 * Compass heading, measured at the center of the photo in degrees clockwise |
| 1136 * from North. Value must be >=0 and <360. |
| 1137 * NaN indicates an unmeasured quantity. |
| 1138 */ |
| 1139 core.double heading; |
| 1140 /** |
| 1141 * Latitude and longitude pair of the pose, as explained here: |
| 1142 * https://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng |
| 1143 * When creating a Photo, if the |
| 1144 * latitude and longitude pair are not provided here, the geolocation from the |
| 1145 * exif header will be used. If the latitude and longitude pair is not |
| 1146 * provided and cannot be found in the exif header, the create photo process |
| 1147 * will fail. |
| 1148 */ |
| 1149 LatLng latLngPair; |
| 1150 /** Level (the floor in a building) used to configure vertical navigation. */ |
| 1151 Level level; |
| 1152 /** |
| 1153 * Pitch, measured at the center of the photo in degrees. Value must be >=-90 |
| 1154 * and <= 90. A value of -90 means looking directly down, and a value of 90 |
| 1155 * means looking directly up. |
| 1156 * NaN indicates an unmeasured quantity. |
| 1157 */ |
| 1158 core.double pitch; |
| 1159 /** |
| 1160 * Roll, measured in degrees. Value must be >= 0 and <360. A value of 0 |
| 1161 * means level with the horizon. |
| 1162 * NaN indicates an unmeasured quantity. |
| 1163 */ |
| 1164 core.double roll; |
| 1165 |
| 1166 Pose(); |
| 1167 |
| 1168 Pose.fromJson(core.Map _json) { |
| 1169 if (_json.containsKey("altitude")) { |
| 1170 altitude = _json["altitude"]; |
| 1171 } |
| 1172 if (_json.containsKey("heading")) { |
| 1173 heading = _json["heading"]; |
| 1174 } |
| 1175 if (_json.containsKey("latLngPair")) { |
| 1176 latLngPair = new LatLng.fromJson(_json["latLngPair"]); |
| 1177 } |
| 1178 if (_json.containsKey("level")) { |
| 1179 level = new Level.fromJson(_json["level"]); |
| 1180 } |
| 1181 if (_json.containsKey("pitch")) { |
| 1182 pitch = _json["pitch"]; |
| 1183 } |
| 1184 if (_json.containsKey("roll")) { |
| 1185 roll = _json["roll"]; |
| 1186 } |
| 1187 } |
| 1188 |
| 1189 core.Map<core.String, core.Object> toJson() { |
| 1190 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1191 if (altitude != null) { |
| 1192 _json["altitude"] = altitude; |
| 1193 } |
| 1194 if (heading != null) { |
| 1195 _json["heading"] = heading; |
| 1196 } |
| 1197 if (latLngPair != null) { |
| 1198 _json["latLngPair"] = (latLngPair).toJson(); |
| 1199 } |
| 1200 if (level != null) { |
| 1201 _json["level"] = (level).toJson(); |
| 1202 } |
| 1203 if (pitch != null) { |
| 1204 _json["pitch"] = pitch; |
| 1205 } |
| 1206 if (roll != null) { |
| 1207 _json["roll"] = roll; |
| 1208 } |
| 1209 return _json; |
| 1210 } |
| 1211 } |
| 1212 |
| 1213 /** |
| 1214 * The `Status` type defines a logical error model that is suitable for |
| 1215 * different |
| 1216 * programming environments, including REST APIs and RPC APIs. It is used by |
| 1217 * [gRPC](https://github.com/grpc). The error model is designed to be: |
| 1218 * |
| 1219 * - Simple to use and understand for most users |
| 1220 * - Flexible enough to meet unexpected needs |
| 1221 * |
| 1222 * # Overview |
| 1223 * |
| 1224 * The `Status` message contains three pieces of data: error code, error |
| 1225 * message, |
| 1226 * and error details. The error code should be an enum value of |
| 1227 * google.rpc.Code, but it may accept additional error codes if needed. The |
| 1228 * error message should be a developer-facing English message that helps |
| 1229 * developers *understand* and *resolve* the error. If a localized user-facing |
| 1230 * error message is needed, put the localized message in the error details or |
| 1231 * localize it in the client. The optional error details may contain arbitrary |
| 1232 * information about the error. There is a predefined set of error detail types |
| 1233 * in the package `google.rpc` that can be used for common error conditions. |
| 1234 * |
| 1235 * # Language mapping |
| 1236 * |
| 1237 * The `Status` message is the logical representation of the error model, but it |
| 1238 * is not necessarily the actual wire format. When the `Status` message is |
| 1239 * exposed in different client libraries and different wire protocols, it can be |
| 1240 * mapped differently. For example, it will likely be mapped to some exceptions |
| 1241 * in Java, but more likely mapped to some error codes in C. |
| 1242 * |
| 1243 * # Other uses |
| 1244 * |
| 1245 * The error model and the `Status` message can be used in a variety of |
| 1246 * environments, either with or without APIs, to provide a |
| 1247 * consistent developer experience across different environments. |
| 1248 * |
| 1249 * Example uses of this error model include: |
| 1250 * |
| 1251 * - Partial errors. If a service needs to return partial errors to the client, |
| 1252 * it may embed the `Status` in the normal response to indicate the partial |
| 1253 * errors. |
| 1254 * |
| 1255 * - Workflow errors. A typical workflow has multiple steps. Each step may |
| 1256 * have a `Status` message for error reporting. |
| 1257 * |
| 1258 * - Batch operations. If a client uses batch request and batch response, the |
| 1259 * `Status` message should be used directly inside batch response, one for |
| 1260 * each error sub-response. |
| 1261 * |
| 1262 * - Asynchronous operations. If an API call embeds asynchronous operation |
| 1263 * results in its response, the status of those operations should be |
| 1264 * represented directly using the `Status` message. |
| 1265 * |
| 1266 * - Logging. If some API errors are stored in logs, the message `Status` could |
| 1267 * be used directly after any stripping needed for security/privacy reasons. |
| 1268 */ |
| 1269 class Status { |
| 1270 /** The status code, which should be an enum value of google.rpc.Code. */ |
| 1271 core.int code; |
| 1272 /** |
| 1273 * A list of messages that carry the error details. There is a common set of |
| 1274 * message types for APIs to use. |
| 1275 * |
| 1276 * The values for Object must be JSON objects. It can consist of `num`, |
| 1277 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1278 */ |
| 1279 core.List<core.Map<core.String, core.Object>> details; |
| 1280 /** |
| 1281 * A developer-facing error message, which should be in English. Any |
| 1282 * user-facing error message should be localized and sent in the |
| 1283 * google.rpc.Status.details field, or localized by the client. |
| 1284 */ |
| 1285 core.String message; |
| 1286 |
| 1287 Status(); |
| 1288 |
| 1289 Status.fromJson(core.Map _json) { |
| 1290 if (_json.containsKey("code")) { |
| 1291 code = _json["code"]; |
| 1292 } |
| 1293 if (_json.containsKey("details")) { |
| 1294 details = _json["details"]; |
| 1295 } |
| 1296 if (_json.containsKey("message")) { |
| 1297 message = _json["message"]; |
| 1298 } |
| 1299 } |
| 1300 |
| 1301 core.Map<core.String, core.Object> toJson() { |
| 1302 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1303 if (code != null) { |
| 1304 _json["code"] = code; |
| 1305 } |
| 1306 if (details != null) { |
| 1307 _json["details"] = details; |
| 1308 } |
| 1309 if (message != null) { |
| 1310 _json["message"] = message; |
| 1311 } |
| 1312 return _json; |
| 1313 } |
| 1314 } |
| 1315 |
| 1316 /** |
| 1317 * Request to update the metadata of a |
| 1318 * Photo. Updating the pixels of a photo |
| 1319 * is not supported. |
| 1320 */ |
| 1321 class UpdatePhotoRequest { |
| 1322 /** |
| 1323 * Required. Photo object containing the |
| 1324 * new metadata. Only the fields specified in |
| 1325 * updateMask |
| 1326 * field are used. If `updateMask` is not present, the update applies to all |
| 1327 * fields. <aside class="note"><b>Note:</b> To update |
| 1328 * Pose.altitude, |
| 1329 * Pose.latLngPair has to be |
| 1330 * filled as well. Otherwise, the request will fail. |
| 1331 */ |
| 1332 Photo photo; |
| 1333 /** |
| 1334 * Mask that identifies fields on the photo metadata to update. |
| 1335 * If not present, the old Photo metadata will be entirely replaced with the |
| 1336 * new Photo metadata in this request. The update fails if invalid fields are |
| 1337 * specified. Multiple fields can be specified in a comma-delimited list. |
| 1338 * |
| 1339 * The following fields are valid: |
| 1340 * |
| 1341 * * `pose.heading` |
| 1342 * * `pose.latlngpair` |
| 1343 * * `pose.pitch` |
| 1344 * * `pose.roll` |
| 1345 * * `pose.level` |
| 1346 * * `pose.altitude` |
| 1347 * * `connections` |
| 1348 * * `places` |
| 1349 * |
| 1350 * |
| 1351 * <aside class="note"><b>Note:</b> Repeated fields in |
| 1352 * updateMask |
| 1353 * mean the entire set of repeated values will be replaced with the new |
| 1354 * contents. For example, if |
| 1355 * updateMask |
| 1356 * contains `connections` and |
| 1357 * google.streetview.publish.v1.UpdatePhotoRequest.photo.connections is |
| 1358 * empty, all connections will be removed.</aside> |
| 1359 */ |
| 1360 core.String updateMask; |
| 1361 |
| 1362 UpdatePhotoRequest(); |
| 1363 |
| 1364 UpdatePhotoRequest.fromJson(core.Map _json) { |
| 1365 if (_json.containsKey("photo")) { |
| 1366 photo = new Photo.fromJson(_json["photo"]); |
| 1367 } |
| 1368 if (_json.containsKey("updateMask")) { |
| 1369 updateMask = _json["updateMask"]; |
| 1370 } |
| 1371 } |
| 1372 |
| 1373 core.Map<core.String, core.Object> toJson() { |
| 1374 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1375 if (photo != null) { |
| 1376 _json["photo"] = (photo).toJson(); |
| 1377 } |
| 1378 if (updateMask != null) { |
| 1379 _json["updateMask"] = updateMask; |
| 1380 } |
| 1381 return _json; |
| 1382 } |
| 1383 } |
| 1384 |
| 1385 /** Upload reference for media files. */ |
| 1386 class UploadRef { |
| 1387 /** |
| 1388 * Required. An upload reference should be unique for each user. It follows |
| 1389 * the form: |
| 1390 * "https://streetviewpublish.googleapis.com/media/user/{account_id}/photo/{up
load_reference}" |
| 1391 */ |
| 1392 core.String uploadUrl; |
| 1393 |
| 1394 UploadRef(); |
| 1395 |
| 1396 UploadRef.fromJson(core.Map _json) { |
| 1397 if (_json.containsKey("uploadUrl")) { |
| 1398 uploadUrl = _json["uploadUrl"]; |
| 1399 } |
| 1400 } |
| 1401 |
| 1402 core.Map<core.String, core.Object> toJson() { |
| 1403 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1404 if (uploadUrl != null) { |
| 1405 _json["uploadUrl"] = uploadUrl; |
| 1406 } |
| 1407 return _json; |
| 1408 } |
| 1409 } |
OLD | NEW |