OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis.androiddeviceprovisioning.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 androiddeviceprovisioning/v1'; |
| 16 |
| 17 /** Android Device Provisioning Partner API */ |
| 18 class AndroiddeviceprovisioningApi { |
| 19 |
| 20 final commons.ApiRequester _requester; |
| 21 |
| 22 OperationsResourceApi get operations => new OperationsResourceApi(_requester); |
| 23 PartnersResourceApi get partners => new PartnersResourceApi(_requester); |
| 24 |
| 25 AndroiddeviceprovisioningApi(http.Client client, {core.String rootUrl: "https:
//androiddeviceprovisioning.googleapis.com/", core.String servicePath: ""}) : |
| 26 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 27 } |
| 28 |
| 29 |
| 30 class OperationsResourceApi { |
| 31 final commons.ApiRequester _requester; |
| 32 |
| 33 OperationsResourceApi(commons.ApiRequester client) : |
| 34 _requester = client; |
| 35 |
| 36 /** |
| 37 * Gets the latest state of a long-running operation. Clients can use this |
| 38 * method to poll the operation result at intervals as recommended by the API |
| 39 * service. |
| 40 * |
| 41 * Request parameters: |
| 42 * |
| 43 * [name] - The name of the operation resource. |
| 44 * Value must have pattern "^operations/.+$". |
| 45 * |
| 46 * Completes with a [Operation]. |
| 47 * |
| 48 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 49 * error. |
| 50 * |
| 51 * If the used [http.Client] completes with an error when making a REST call, |
| 52 * this method will complete with the same error. |
| 53 */ |
| 54 async.Future<Operation> get(core.String name) { |
| 55 var _url = null; |
| 56 var _queryParams = new core.Map(); |
| 57 var _uploadMedia = null; |
| 58 var _uploadOptions = null; |
| 59 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 60 var _body = null; |
| 61 |
| 62 if (name == null) { |
| 63 throw new core.ArgumentError("Parameter name is required."); |
| 64 } |
| 65 |
| 66 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 67 |
| 68 var _response = _requester.request(_url, |
| 69 "GET", |
| 70 body: _body, |
| 71 queryParams: _queryParams, |
| 72 uploadOptions: _uploadOptions, |
| 73 uploadMedia: _uploadMedia, |
| 74 downloadOptions: _downloadOptions); |
| 75 return _response.then((data) => new Operation.fromJson(data)); |
| 76 } |
| 77 |
| 78 } |
| 79 |
| 80 |
| 81 class PartnersResourceApi { |
| 82 final commons.ApiRequester _requester; |
| 83 |
| 84 PartnersCustomersResourceApi get customers => new PartnersCustomersResourceApi
(_requester); |
| 85 PartnersDevicesResourceApi get devices => new PartnersDevicesResourceApi(_requ
ester); |
| 86 |
| 87 PartnersResourceApi(commons.ApiRequester client) : |
| 88 _requester = client; |
| 89 } |
| 90 |
| 91 |
| 92 class PartnersCustomersResourceApi { |
| 93 final commons.ApiRequester _requester; |
| 94 |
| 95 PartnersCustomersResourceApi(commons.ApiRequester client) : |
| 96 _requester = client; |
| 97 |
| 98 /** |
| 99 * List all the customers that has delegates some role to this customer. |
| 100 * |
| 101 * Request parameters: |
| 102 * |
| 103 * [partnerId] - the id of the partner. |
| 104 * Value must have pattern "^[^/]+$". |
| 105 * |
| 106 * Completes with a [ListCustomersResponse]. |
| 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<ListCustomersResponse> list(core.String partnerId) { |
| 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 (partnerId == null) { |
| 123 throw new core.ArgumentError("Parameter partnerId is required."); |
| 124 } |
| 125 |
| 126 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/customers'; |
| 127 |
| 128 var _response = _requester.request(_url, |
| 129 "GET", |
| 130 body: _body, |
| 131 queryParams: _queryParams, |
| 132 uploadOptions: _uploadOptions, |
| 133 uploadMedia: _uploadMedia, |
| 134 downloadOptions: _downloadOptions); |
| 135 return _response.then((data) => new ListCustomersResponse.fromJson(data)); |
| 136 } |
| 137 |
| 138 } |
| 139 |
| 140 |
| 141 class PartnersDevicesResourceApi { |
| 142 final commons.ApiRequester _requester; |
| 143 |
| 144 PartnersDevicesResourceApi(commons.ApiRequester client) : |
| 145 _requester = client; |
| 146 |
| 147 /** |
| 148 * Claim the device identified by device identifier. |
| 149 * |
| 150 * [request] - The metadata request object. |
| 151 * |
| 152 * Request parameters: |
| 153 * |
| 154 * [partnerId] - Id of the partner. |
| 155 * Value must have pattern "^[^/]+$". |
| 156 * |
| 157 * Completes with a [ClaimDeviceResponse]. |
| 158 * |
| 159 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 160 * error. |
| 161 * |
| 162 * If the used [http.Client] completes with an error when making a REST call, |
| 163 * this method will complete with the same error. |
| 164 */ |
| 165 async.Future<ClaimDeviceResponse> claim(ClaimDeviceRequest request, core.Strin
g partnerId) { |
| 166 var _url = null; |
| 167 var _queryParams = new core.Map(); |
| 168 var _uploadMedia = null; |
| 169 var _uploadOptions = null; |
| 170 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 171 var _body = null; |
| 172 |
| 173 if (request != null) { |
| 174 _body = convert.JSON.encode((request).toJson()); |
| 175 } |
| 176 if (partnerId == null) { |
| 177 throw new core.ArgumentError("Parameter partnerId is required."); |
| 178 } |
| 179 |
| 180 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/devices:claim'; |
| 181 |
| 182 var _response = _requester.request(_url, |
| 183 "POST", |
| 184 body: _body, |
| 185 queryParams: _queryParams, |
| 186 uploadOptions: _uploadOptions, |
| 187 uploadMedia: _uploadMedia, |
| 188 downloadOptions: _downloadOptions); |
| 189 return _response.then((data) => new ClaimDeviceResponse.fromJson(data)); |
| 190 } |
| 191 |
| 192 /** |
| 193 * Claim devices asynchronously |
| 194 * |
| 195 * [request] - The metadata request object. |
| 196 * |
| 197 * Request parameters: |
| 198 * |
| 199 * [partnerId] - partner id. |
| 200 * Value must have pattern "^[^/]+$". |
| 201 * |
| 202 * Completes with a [Operation]. |
| 203 * |
| 204 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 205 * error. |
| 206 * |
| 207 * If the used [http.Client] completes with an error when making a REST call, |
| 208 * this method will complete with the same error. |
| 209 */ |
| 210 async.Future<Operation> claimAsync(ClaimDevicesRequest request, core.String pa
rtnerId) { |
| 211 var _url = null; |
| 212 var _queryParams = new core.Map(); |
| 213 var _uploadMedia = null; |
| 214 var _uploadOptions = null; |
| 215 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 216 var _body = null; |
| 217 |
| 218 if (request != null) { |
| 219 _body = convert.JSON.encode((request).toJson()); |
| 220 } |
| 221 if (partnerId == null) { |
| 222 throw new core.ArgumentError("Parameter partnerId is required."); |
| 223 } |
| 224 |
| 225 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/devices:claimAsync'; |
| 226 |
| 227 var _response = _requester.request(_url, |
| 228 "POST", |
| 229 body: _body, |
| 230 queryParams: _queryParams, |
| 231 uploadOptions: _uploadOptions, |
| 232 uploadMedia: _uploadMedia, |
| 233 downloadOptions: _downloadOptions); |
| 234 return _response.then((data) => new Operation.fromJson(data)); |
| 235 } |
| 236 |
| 237 /** |
| 238 * Find devices by device identifier. |
| 239 * |
| 240 * [request] - The metadata request object. |
| 241 * |
| 242 * Request parameters: |
| 243 * |
| 244 * [partnerId] - id of the partner. |
| 245 * Value must have pattern "^[^/]+$". |
| 246 * |
| 247 * Completes with a [FindDevicesByDeviceIdentifierResponse]. |
| 248 * |
| 249 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 250 * error. |
| 251 * |
| 252 * If the used [http.Client] completes with an error when making a REST call, |
| 253 * this method will complete with the same error. |
| 254 */ |
| 255 async.Future<FindDevicesByDeviceIdentifierResponse> findByIdentifier(FindDevic
esByDeviceIdentifierRequest request, core.String partnerId) { |
| 256 var _url = null; |
| 257 var _queryParams = new core.Map(); |
| 258 var _uploadMedia = null; |
| 259 var _uploadOptions = null; |
| 260 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 261 var _body = null; |
| 262 |
| 263 if (request != null) { |
| 264 _body = convert.JSON.encode((request).toJson()); |
| 265 } |
| 266 if (partnerId == null) { |
| 267 throw new core.ArgumentError("Parameter partnerId is required."); |
| 268 } |
| 269 |
| 270 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/devices:findByIdentifier'; |
| 271 |
| 272 var _response = _requester.request(_url, |
| 273 "POST", |
| 274 body: _body, |
| 275 queryParams: _queryParams, |
| 276 uploadOptions: _uploadOptions, |
| 277 uploadMedia: _uploadMedia, |
| 278 downloadOptions: _downloadOptions); |
| 279 return _response.then((data) => new FindDevicesByDeviceIdentifierResponse.fr
omJson(data)); |
| 280 } |
| 281 |
| 282 /** |
| 283 * Find devices by ownership. |
| 284 * |
| 285 * [request] - The metadata request object. |
| 286 * |
| 287 * Request parameters: |
| 288 * |
| 289 * [partnerId] - id of the partner. |
| 290 * Value must have pattern "^[^/]+$". |
| 291 * |
| 292 * Completes with a [FindDevicesByOwnerResponse]. |
| 293 * |
| 294 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 295 * error. |
| 296 * |
| 297 * If the used [http.Client] completes with an error when making a REST call, |
| 298 * this method will complete with the same error. |
| 299 */ |
| 300 async.Future<FindDevicesByOwnerResponse> findByOwner(FindDevicesByOwnerRequest
request, core.String partnerId) { |
| 301 var _url = null; |
| 302 var _queryParams = new core.Map(); |
| 303 var _uploadMedia = null; |
| 304 var _uploadOptions = null; |
| 305 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 306 var _body = null; |
| 307 |
| 308 if (request != null) { |
| 309 _body = convert.JSON.encode((request).toJson()); |
| 310 } |
| 311 if (partnerId == null) { |
| 312 throw new core.ArgumentError("Parameter partnerId is required."); |
| 313 } |
| 314 |
| 315 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/devices:findByOwner'; |
| 316 |
| 317 var _response = _requester.request(_url, |
| 318 "POST", |
| 319 body: _body, |
| 320 queryParams: _queryParams, |
| 321 uploadOptions: _uploadOptions, |
| 322 uploadMedia: _uploadMedia, |
| 323 downloadOptions: _downloadOptions); |
| 324 return _response.then((data) => new FindDevicesByOwnerResponse.fromJson(data
)); |
| 325 } |
| 326 |
| 327 /** |
| 328 * Get a device |
| 329 * |
| 330 * Request parameters: |
| 331 * |
| 332 * [name] - resource name in 'partners/[PARTNER_ID]/devices/[DEVICE_ID]'. |
| 333 * Value must have pattern "^partners/[^/]+/devices/[^/]+$". |
| 334 * |
| 335 * Completes with a [Device]. |
| 336 * |
| 337 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 338 * error. |
| 339 * |
| 340 * If the used [http.Client] completes with an error when making a REST call, |
| 341 * this method will complete with the same error. |
| 342 */ |
| 343 async.Future<Device> get(core.String name) { |
| 344 var _url = null; |
| 345 var _queryParams = new core.Map(); |
| 346 var _uploadMedia = null; |
| 347 var _uploadOptions = null; |
| 348 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 349 var _body = null; |
| 350 |
| 351 if (name == null) { |
| 352 throw new core.ArgumentError("Parameter name is required."); |
| 353 } |
| 354 |
| 355 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 356 |
| 357 var _response = _requester.request(_url, |
| 358 "GET", |
| 359 body: _body, |
| 360 queryParams: _queryParams, |
| 361 uploadOptions: _uploadOptions, |
| 362 uploadMedia: _uploadMedia, |
| 363 downloadOptions: _downloadOptions); |
| 364 return _response.then((data) => new Device.fromJson(data)); |
| 365 } |
| 366 |
| 367 /** |
| 368 * Update the metadata |
| 369 * |
| 370 * [request] - The metadata request object. |
| 371 * |
| 372 * Request parameters: |
| 373 * |
| 374 * [metadataOwnerId] - The owner of the newly set metadata. Should be partner |
| 375 * id itself. |
| 376 * Value must have pattern "^[^/]+$". |
| 377 * |
| 378 * [deviceId] - id of the partner. |
| 379 * Value must have pattern "^[^/]+$". |
| 380 * |
| 381 * Completes with a [DeviceMetadata]. |
| 382 * |
| 383 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 384 * error. |
| 385 * |
| 386 * If the used [http.Client] completes with an error when making a REST call, |
| 387 * this method will complete with the same error. |
| 388 */ |
| 389 async.Future<DeviceMetadata> metadata(UpdateDeviceMetadataRequest request, cor
e.String metadataOwnerId, core.String deviceId) { |
| 390 var _url = null; |
| 391 var _queryParams = new core.Map(); |
| 392 var _uploadMedia = null; |
| 393 var _uploadOptions = null; |
| 394 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 395 var _body = null; |
| 396 |
| 397 if (request != null) { |
| 398 _body = convert.JSON.encode((request).toJson()); |
| 399 } |
| 400 if (metadataOwnerId == null) { |
| 401 throw new core.ArgumentError("Parameter metadataOwnerId is required."); |
| 402 } |
| 403 if (deviceId == null) { |
| 404 throw new core.ArgumentError("Parameter deviceId is required."); |
| 405 } |
| 406 |
| 407 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$metadataOwne
rId') + '/devices/' + commons.Escaper.ecapeVariableReserved('$deviceId') + '/met
adata'; |
| 408 |
| 409 var _response = _requester.request(_url, |
| 410 "POST", |
| 411 body: _body, |
| 412 queryParams: _queryParams, |
| 413 uploadOptions: _uploadOptions, |
| 414 uploadMedia: _uploadMedia, |
| 415 downloadOptions: _downloadOptions); |
| 416 return _response.then((data) => new DeviceMetadata.fromJson(data)); |
| 417 } |
| 418 |
| 419 /** |
| 420 * Unclaim the device identified by device_id or identifier. |
| 421 * |
| 422 * [request] - The metadata request object. |
| 423 * |
| 424 * Request parameters: |
| 425 * |
| 426 * [partnerId] - Id of the partner. |
| 427 * Value must have pattern "^[^/]+$". |
| 428 * |
| 429 * Completes with a [Empty]. |
| 430 * |
| 431 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 432 * error. |
| 433 * |
| 434 * If the used [http.Client] completes with an error when making a REST call, |
| 435 * this method will complete with the same error. |
| 436 */ |
| 437 async.Future<Empty> unclaim(UnclaimDeviceRequest request, core.String partnerI
d) { |
| 438 var _url = null; |
| 439 var _queryParams = new core.Map(); |
| 440 var _uploadMedia = null; |
| 441 var _uploadOptions = null; |
| 442 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 443 var _body = null; |
| 444 |
| 445 if (request != null) { |
| 446 _body = convert.JSON.encode((request).toJson()); |
| 447 } |
| 448 if (partnerId == null) { |
| 449 throw new core.ArgumentError("Parameter partnerId is required."); |
| 450 } |
| 451 |
| 452 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/devices:unclaim'; |
| 453 |
| 454 var _response = _requester.request(_url, |
| 455 "POST", |
| 456 body: _body, |
| 457 queryParams: _queryParams, |
| 458 uploadOptions: _uploadOptions, |
| 459 uploadMedia: _uploadMedia, |
| 460 downloadOptions: _downloadOptions); |
| 461 return _response.then((data) => new Empty.fromJson(data)); |
| 462 } |
| 463 |
| 464 /** |
| 465 * Unclaim devices asynchronously |
| 466 * |
| 467 * [request] - The metadata request object. |
| 468 * |
| 469 * Request parameters: |
| 470 * |
| 471 * [partnerId] - partner id. |
| 472 * Value must have pattern "^[^/]+$". |
| 473 * |
| 474 * Completes with a [Operation]. |
| 475 * |
| 476 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 477 * error. |
| 478 * |
| 479 * If the used [http.Client] completes with an error when making a REST call, |
| 480 * this method will complete with the same error. |
| 481 */ |
| 482 async.Future<Operation> unclaimAsync(UnclaimDevicesRequest request, core.Strin
g partnerId) { |
| 483 var _url = null; |
| 484 var _queryParams = new core.Map(); |
| 485 var _uploadMedia = null; |
| 486 var _uploadOptions = null; |
| 487 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 488 var _body = null; |
| 489 |
| 490 if (request != null) { |
| 491 _body = convert.JSON.encode((request).toJson()); |
| 492 } |
| 493 if (partnerId == null) { |
| 494 throw new core.ArgumentError("Parameter partnerId is required."); |
| 495 } |
| 496 |
| 497 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/devices:unclaimAsync'; |
| 498 |
| 499 var _response = _requester.request(_url, |
| 500 "POST", |
| 501 body: _body, |
| 502 queryParams: _queryParams, |
| 503 uploadOptions: _uploadOptions, |
| 504 uploadMedia: _uploadMedia, |
| 505 downloadOptions: _downloadOptions); |
| 506 return _response.then((data) => new Operation.fromJson(data)); |
| 507 } |
| 508 |
| 509 /** |
| 510 * Set metadata in batch asynchronously. |
| 511 * |
| 512 * [request] - The metadata request object. |
| 513 * |
| 514 * Request parameters: |
| 515 * |
| 516 * [partnerId] - partner id. |
| 517 * Value must have pattern "^[^/]+$". |
| 518 * |
| 519 * Completes with a [Operation]. |
| 520 * |
| 521 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 522 * error. |
| 523 * |
| 524 * If the used [http.Client] completes with an error when making a REST call, |
| 525 * this method will complete with the same error. |
| 526 */ |
| 527 async.Future<Operation> updateMetadataAsync(UpdateDeviceMetadataInBatchRequest
request, core.String partnerId) { |
| 528 var _url = null; |
| 529 var _queryParams = new core.Map(); |
| 530 var _uploadMedia = null; |
| 531 var _uploadOptions = null; |
| 532 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 533 var _body = null; |
| 534 |
| 535 if (request != null) { |
| 536 _body = convert.JSON.encode((request).toJson()); |
| 537 } |
| 538 if (partnerId == null) { |
| 539 throw new core.ArgumentError("Parameter partnerId is required."); |
| 540 } |
| 541 |
| 542 _url = 'v1/partners/' + commons.Escaper.ecapeVariableReserved('$partnerId')
+ '/devices:updateMetadataAsync'; |
| 543 |
| 544 var _response = _requester.request(_url, |
| 545 "POST", |
| 546 body: _body, |
| 547 queryParams: _queryParams, |
| 548 uploadOptions: _uploadOptions, |
| 549 uploadMedia: _uploadMedia, |
| 550 downloadOptions: _downloadOptions); |
| 551 return _response.then((data) => new Operation.fromJson(data)); |
| 552 } |
| 553 |
| 554 } |
| 555 |
| 556 |
| 557 |
| 558 /** Request message to claim a device on behalf of a customer. */ |
| 559 class ClaimDeviceRequest { |
| 560 /** The customer to claim for. */ |
| 561 core.String customerId; |
| 562 /** The device identifier of the device to claim. */ |
| 563 DeviceIdentifier deviceIdentifier; |
| 564 /** |
| 565 * Section to claim |
| 566 * Possible string values are: |
| 567 * - "SECTION_TYPE_UNSPECIFIED" : Unspecified |
| 568 * - "SECTION_TYPE_ZERO_TOUCH" : Zero touch |
| 569 */ |
| 570 core.String sectionType; |
| 571 |
| 572 ClaimDeviceRequest(); |
| 573 |
| 574 ClaimDeviceRequest.fromJson(core.Map _json) { |
| 575 if (_json.containsKey("customerId")) { |
| 576 customerId = _json["customerId"]; |
| 577 } |
| 578 if (_json.containsKey("deviceIdentifier")) { |
| 579 deviceIdentifier = new DeviceIdentifier.fromJson(_json["deviceIdentifier"]
); |
| 580 } |
| 581 if (_json.containsKey("sectionType")) { |
| 582 sectionType = _json["sectionType"]; |
| 583 } |
| 584 } |
| 585 |
| 586 core.Map<core.String, core.Object> toJson() { |
| 587 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 588 if (customerId != null) { |
| 589 _json["customerId"] = customerId; |
| 590 } |
| 591 if (deviceIdentifier != null) { |
| 592 _json["deviceIdentifier"] = (deviceIdentifier).toJson(); |
| 593 } |
| 594 if (sectionType != null) { |
| 595 _json["sectionType"] = sectionType; |
| 596 } |
| 597 return _json; |
| 598 } |
| 599 } |
| 600 |
| 601 /** Response message containing device id of the claim. */ |
| 602 class ClaimDeviceResponse { |
| 603 /** the device id of the claimed device. */ |
| 604 core.String deviceId; |
| 605 /** |
| 606 * the resource name of the device in |
| 607 * 'partners/[PARTNER_ID]/devices/[DEVICE_ID]'. |
| 608 */ |
| 609 core.String deviceName; |
| 610 |
| 611 ClaimDeviceResponse(); |
| 612 |
| 613 ClaimDeviceResponse.fromJson(core.Map _json) { |
| 614 if (_json.containsKey("deviceId")) { |
| 615 deviceId = _json["deviceId"]; |
| 616 } |
| 617 if (_json.containsKey("deviceName")) { |
| 618 deviceName = _json["deviceName"]; |
| 619 } |
| 620 } |
| 621 |
| 622 core.Map<core.String, core.Object> toJson() { |
| 623 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 624 if (deviceId != null) { |
| 625 _json["deviceId"] = deviceId; |
| 626 } |
| 627 if (deviceName != null) { |
| 628 _json["deviceName"] = deviceName; |
| 629 } |
| 630 return _json; |
| 631 } |
| 632 } |
| 633 |
| 634 /** Request to claim devices asynchronously in batch. */ |
| 635 class ClaimDevicesRequest { |
| 636 /** list of claims. */ |
| 637 core.List<PartnerClaim> claims; |
| 638 |
| 639 ClaimDevicesRequest(); |
| 640 |
| 641 ClaimDevicesRequest.fromJson(core.Map _json) { |
| 642 if (_json.containsKey("claims")) { |
| 643 claims = _json["claims"].map((value) => new PartnerClaim.fromJson(value)).
toList(); |
| 644 } |
| 645 } |
| 646 |
| 647 core.Map<core.String, core.Object> toJson() { |
| 648 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 649 if (claims != null) { |
| 650 _json["claims"] = claims.map((value) => (value).toJson()).toList(); |
| 651 } |
| 652 return _json; |
| 653 } |
| 654 } |
| 655 |
| 656 /** Company */ |
| 657 class Company { |
| 658 /** company id */ |
| 659 core.String companyId; |
| 660 /** company name */ |
| 661 core.String companyName; |
| 662 |
| 663 Company(); |
| 664 |
| 665 Company.fromJson(core.Map _json) { |
| 666 if (_json.containsKey("companyId")) { |
| 667 companyId = _json["companyId"]; |
| 668 } |
| 669 if (_json.containsKey("companyName")) { |
| 670 companyName = _json["companyName"]; |
| 671 } |
| 672 } |
| 673 |
| 674 core.Map<core.String, core.Object> toJson() { |
| 675 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 676 if (companyId != null) { |
| 677 _json["companyId"] = companyId; |
| 678 } |
| 679 if (companyName != null) { |
| 680 _json["companyName"] = companyName; |
| 681 } |
| 682 return _json; |
| 683 } |
| 684 } |
| 685 |
| 686 /** Device */ |
| 687 class Device { |
| 688 /** claims */ |
| 689 core.List<DeviceClaim> claims; |
| 690 /** Device id */ |
| 691 core.String deviceId; |
| 692 /** Device identifier */ |
| 693 DeviceIdentifier deviceIdentifier; |
| 694 /** Device metadata */ |
| 695 DeviceMetadata deviceMetadata; |
| 696 /** Resource name in 'partners/[PARTNER_ID]/devices/[DEVICE_ID]'. */ |
| 697 core.String name; |
| 698 |
| 699 Device(); |
| 700 |
| 701 Device.fromJson(core.Map _json) { |
| 702 if (_json.containsKey("claims")) { |
| 703 claims = _json["claims"].map((value) => new DeviceClaim.fromJson(value)).t
oList(); |
| 704 } |
| 705 if (_json.containsKey("deviceId")) { |
| 706 deviceId = _json["deviceId"]; |
| 707 } |
| 708 if (_json.containsKey("deviceIdentifier")) { |
| 709 deviceIdentifier = new DeviceIdentifier.fromJson(_json["deviceIdentifier"]
); |
| 710 } |
| 711 if (_json.containsKey("deviceMetadata")) { |
| 712 deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]); |
| 713 } |
| 714 if (_json.containsKey("name")) { |
| 715 name = _json["name"]; |
| 716 } |
| 717 } |
| 718 |
| 719 core.Map<core.String, core.Object> toJson() { |
| 720 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 721 if (claims != null) { |
| 722 _json["claims"] = claims.map((value) => (value).toJson()).toList(); |
| 723 } |
| 724 if (deviceId != null) { |
| 725 _json["deviceId"] = deviceId; |
| 726 } |
| 727 if (deviceIdentifier != null) { |
| 728 _json["deviceIdentifier"] = (deviceIdentifier).toJson(); |
| 729 } |
| 730 if (deviceMetadata != null) { |
| 731 _json["deviceMetadata"] = (deviceMetadata).toJson(); |
| 732 } |
| 733 if (name != null) { |
| 734 _json["name"] = name; |
| 735 } |
| 736 return _json; |
| 737 } |
| 738 } |
| 739 |
| 740 /** containing the necessary info about a claim for a partner. */ |
| 741 class DeviceClaim { |
| 742 /** owner id */ |
| 743 core.String ownerCompanyId; |
| 744 /** |
| 745 * section type. |
| 746 * Possible string values are: |
| 747 * - "SECTION_TYPE_UNSPECIFIED" : Unspecified |
| 748 * - "SECTION_TYPE_ZERO_TOUCH" : Zero touch |
| 749 */ |
| 750 core.String sectionType; |
| 751 |
| 752 DeviceClaim(); |
| 753 |
| 754 DeviceClaim.fromJson(core.Map _json) { |
| 755 if (_json.containsKey("ownerCompanyId")) { |
| 756 ownerCompanyId = _json["ownerCompanyId"]; |
| 757 } |
| 758 if (_json.containsKey("sectionType")) { |
| 759 sectionType = _json["sectionType"]; |
| 760 } |
| 761 } |
| 762 |
| 763 core.Map<core.String, core.Object> toJson() { |
| 764 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 765 if (ownerCompanyId != null) { |
| 766 _json["ownerCompanyId"] = ownerCompanyId; |
| 767 } |
| 768 if (sectionType != null) { |
| 769 _json["sectionType"] = sectionType; |
| 770 } |
| 771 return _json; |
| 772 } |
| 773 } |
| 774 |
| 775 /** DeviceIdentifiers identifies an unique device. */ |
| 776 class DeviceIdentifier { |
| 777 /** IMEI (either IMEI or MEID is required). */ |
| 778 core.String imei; |
| 779 /** Manufacturer to match android.os.Build.MANUFACTURER (required). */ |
| 780 core.String manufacturer; |
| 781 /** MEID */ |
| 782 core.String meid; |
| 783 /** Model to match android.os.Build.MODEL (required). */ |
| 784 core.String model; |
| 785 /** Serial number (optional) */ |
| 786 core.String serialNumber; |
| 787 |
| 788 DeviceIdentifier(); |
| 789 |
| 790 DeviceIdentifier.fromJson(core.Map _json) { |
| 791 if (_json.containsKey("imei")) { |
| 792 imei = _json["imei"]; |
| 793 } |
| 794 if (_json.containsKey("manufacturer")) { |
| 795 manufacturer = _json["manufacturer"]; |
| 796 } |
| 797 if (_json.containsKey("meid")) { |
| 798 meid = _json["meid"]; |
| 799 } |
| 800 if (_json.containsKey("model")) { |
| 801 model = _json["model"]; |
| 802 } |
| 803 if (_json.containsKey("serialNumber")) { |
| 804 serialNumber = _json["serialNumber"]; |
| 805 } |
| 806 } |
| 807 |
| 808 core.Map<core.String, core.Object> toJson() { |
| 809 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 810 if (imei != null) { |
| 811 _json["imei"] = imei; |
| 812 } |
| 813 if (manufacturer != null) { |
| 814 _json["manufacturer"] = manufacturer; |
| 815 } |
| 816 if (meid != null) { |
| 817 _json["meid"] = meid; |
| 818 } |
| 819 if (model != null) { |
| 820 _json["model"] = model; |
| 821 } |
| 822 if (serialNumber != null) { |
| 823 _json["serialNumber"] = serialNumber; |
| 824 } |
| 825 return _json; |
| 826 } |
| 827 } |
| 828 |
| 829 /** metadata */ |
| 830 class DeviceMetadata { |
| 831 /** Metadata entries */ |
| 832 core.Map<core.String, core.String> entries; |
| 833 |
| 834 DeviceMetadata(); |
| 835 |
| 836 DeviceMetadata.fromJson(core.Map _json) { |
| 837 if (_json.containsKey("entries")) { |
| 838 entries = _json["entries"]; |
| 839 } |
| 840 } |
| 841 |
| 842 core.Map<core.String, core.Object> toJson() { |
| 843 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 844 if (entries != null) { |
| 845 _json["entries"] = entries; |
| 846 } |
| 847 return _json; |
| 848 } |
| 849 } |
| 850 |
| 851 /** Long running operation metadata. */ |
| 852 class DevicesLongRunningOperationMetadata { |
| 853 /** Number of devices parsed in your requests. */ |
| 854 core.int devicesCount; |
| 855 /** |
| 856 * The overall processing status. |
| 857 * Possible string values are: |
| 858 * - "BATCH_PROCESS_STATUS_UNSPECIFIED" : Invalid code. Shouldn't be used. |
| 859 * - "BATCH_PROCESS_PENDING" : Pending |
| 860 * - "BATCH_PROCESS_IN_PROGRESS" : In progress |
| 861 * - "BATCH_PROCESS_PROCESSED" : Processed. |
| 862 * This doesn't mean all items were processed sucessfully, you should |
| 863 * check the `response` field for the result of every item. |
| 864 */ |
| 865 core.String processingStatus; |
| 866 /** Processing progress from 0 to 100. */ |
| 867 core.int progress; |
| 868 |
| 869 DevicesLongRunningOperationMetadata(); |
| 870 |
| 871 DevicesLongRunningOperationMetadata.fromJson(core.Map _json) { |
| 872 if (_json.containsKey("devicesCount")) { |
| 873 devicesCount = _json["devicesCount"]; |
| 874 } |
| 875 if (_json.containsKey("processingStatus")) { |
| 876 processingStatus = _json["processingStatus"]; |
| 877 } |
| 878 if (_json.containsKey("progress")) { |
| 879 progress = _json["progress"]; |
| 880 } |
| 881 } |
| 882 |
| 883 core.Map<core.String, core.Object> toJson() { |
| 884 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 885 if (devicesCount != null) { |
| 886 _json["devicesCount"] = devicesCount; |
| 887 } |
| 888 if (processingStatus != null) { |
| 889 _json["processingStatus"] = processingStatus; |
| 890 } |
| 891 if (progress != null) { |
| 892 _json["progress"] = progress; |
| 893 } |
| 894 return _json; |
| 895 } |
| 896 } |
| 897 |
| 898 /** Long running operation response. */ |
| 899 class DevicesLongRunningOperationResponse { |
| 900 /** |
| 901 * processing status for each device. |
| 902 * One PerDeviceStatus per device. The order is the same as in your requests. |
| 903 */ |
| 904 core.List<OperationPerDevice> perDeviceStatus; |
| 905 /** Number of succeesfully processed ones. */ |
| 906 core.int successCount; |
| 907 |
| 908 DevicesLongRunningOperationResponse(); |
| 909 |
| 910 DevicesLongRunningOperationResponse.fromJson(core.Map _json) { |
| 911 if (_json.containsKey("perDeviceStatus")) { |
| 912 perDeviceStatus = _json["perDeviceStatus"].map((value) => new OperationPer
Device.fromJson(value)).toList(); |
| 913 } |
| 914 if (_json.containsKey("successCount")) { |
| 915 successCount = _json["successCount"]; |
| 916 } |
| 917 } |
| 918 |
| 919 core.Map<core.String, core.Object> toJson() { |
| 920 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 921 if (perDeviceStatus != null) { |
| 922 _json["perDeviceStatus"] = perDeviceStatus.map((value) => (value).toJson()
).toList(); |
| 923 } |
| 924 if (successCount != null) { |
| 925 _json["successCount"] = successCount; |
| 926 } |
| 927 return _json; |
| 928 } |
| 929 } |
| 930 |
| 931 /** |
| 932 * A generic empty message that you can re-use to avoid defining duplicated |
| 933 * empty messages in your APIs. A typical example is to use it as the request |
| 934 * or the response type of an API method. For instance: |
| 935 * |
| 936 * service Foo { |
| 937 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 938 * } |
| 939 * |
| 940 * The JSON representation for `Empty` is empty JSON object `{}`. |
| 941 */ |
| 942 class Empty { |
| 943 |
| 944 Empty(); |
| 945 |
| 946 Empty.fromJson(core.Map _json) { |
| 947 } |
| 948 |
| 949 core.Map<core.String, core.Object> toJson() { |
| 950 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 951 return _json; |
| 952 } |
| 953 } |
| 954 |
| 955 /** Request to find devices. */ |
| 956 class FindDevicesByDeviceIdentifierRequest { |
| 957 /** The device identifier to search */ |
| 958 DeviceIdentifier deviceIdentifier; |
| 959 /** Number of devices to show. */ |
| 960 core.String limit; |
| 961 /** Page token */ |
| 962 core.String pageToken; |
| 963 |
| 964 FindDevicesByDeviceIdentifierRequest(); |
| 965 |
| 966 FindDevicesByDeviceIdentifierRequest.fromJson(core.Map _json) { |
| 967 if (_json.containsKey("deviceIdentifier")) { |
| 968 deviceIdentifier = new DeviceIdentifier.fromJson(_json["deviceIdentifier"]
); |
| 969 } |
| 970 if (_json.containsKey("limit")) { |
| 971 limit = _json["limit"]; |
| 972 } |
| 973 if (_json.containsKey("pageToken")) { |
| 974 pageToken = _json["pageToken"]; |
| 975 } |
| 976 } |
| 977 |
| 978 core.Map<core.String, core.Object> toJson() { |
| 979 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 980 if (deviceIdentifier != null) { |
| 981 _json["deviceIdentifier"] = (deviceIdentifier).toJson(); |
| 982 } |
| 983 if (limit != null) { |
| 984 _json["limit"] = limit; |
| 985 } |
| 986 if (pageToken != null) { |
| 987 _json["pageToken"] = pageToken; |
| 988 } |
| 989 return _json; |
| 990 } |
| 991 } |
| 992 |
| 993 /** Response containing found devices. */ |
| 994 class FindDevicesByDeviceIdentifierResponse { |
| 995 /** Found devices. */ |
| 996 core.List<Device> devices; |
| 997 /** Page token of next page */ |
| 998 core.String nextPageToken; |
| 999 |
| 1000 FindDevicesByDeviceIdentifierResponse(); |
| 1001 |
| 1002 FindDevicesByDeviceIdentifierResponse.fromJson(core.Map _json) { |
| 1003 if (_json.containsKey("devices")) { |
| 1004 devices = _json["devices"].map((value) => new Device.fromJson(value)).toLi
st(); |
| 1005 } |
| 1006 if (_json.containsKey("nextPageToken")) { |
| 1007 nextPageToken = _json["nextPageToken"]; |
| 1008 } |
| 1009 } |
| 1010 |
| 1011 core.Map<core.String, core.Object> toJson() { |
| 1012 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1013 if (devices != null) { |
| 1014 _json["devices"] = devices.map((value) => (value).toJson()).toList(); |
| 1015 } |
| 1016 if (nextPageToken != null) { |
| 1017 _json["nextPageToken"] = nextPageToken; |
| 1018 } |
| 1019 return _json; |
| 1020 } |
| 1021 } |
| 1022 |
| 1023 /** Request to find devices by customers. */ |
| 1024 class FindDevicesByOwnerRequest { |
| 1025 /** List of customer ids to search for. */ |
| 1026 core.List<core.String> customerId; |
| 1027 /** The number of devices to show in the result. */ |
| 1028 core.String limit; |
| 1029 /** Page token */ |
| 1030 core.String pageToken; |
| 1031 /** |
| 1032 * The section type. |
| 1033 * Possible string values are: |
| 1034 * - "SECTION_TYPE_UNSPECIFIED" : Unspecified |
| 1035 * - "SECTION_TYPE_ZERO_TOUCH" : Zero touch |
| 1036 */ |
| 1037 core.String sectionType; |
| 1038 |
| 1039 FindDevicesByOwnerRequest(); |
| 1040 |
| 1041 FindDevicesByOwnerRequest.fromJson(core.Map _json) { |
| 1042 if (_json.containsKey("customerId")) { |
| 1043 customerId = _json["customerId"]; |
| 1044 } |
| 1045 if (_json.containsKey("limit")) { |
| 1046 limit = _json["limit"]; |
| 1047 } |
| 1048 if (_json.containsKey("pageToken")) { |
| 1049 pageToken = _json["pageToken"]; |
| 1050 } |
| 1051 if (_json.containsKey("sectionType")) { |
| 1052 sectionType = _json["sectionType"]; |
| 1053 } |
| 1054 } |
| 1055 |
| 1056 core.Map<core.String, core.Object> toJson() { |
| 1057 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1058 if (customerId != null) { |
| 1059 _json["customerId"] = customerId; |
| 1060 } |
| 1061 if (limit != null) { |
| 1062 _json["limit"] = limit; |
| 1063 } |
| 1064 if (pageToken != null) { |
| 1065 _json["pageToken"] = pageToken; |
| 1066 } |
| 1067 if (sectionType != null) { |
| 1068 _json["sectionType"] = sectionType; |
| 1069 } |
| 1070 return _json; |
| 1071 } |
| 1072 } |
| 1073 |
| 1074 /** Response containing found devices. */ |
| 1075 class FindDevicesByOwnerResponse { |
| 1076 /** Devices found. */ |
| 1077 core.List<Device> devices; |
| 1078 /** Page token of next page */ |
| 1079 core.String nextPageToken; |
| 1080 |
| 1081 FindDevicesByOwnerResponse(); |
| 1082 |
| 1083 FindDevicesByOwnerResponse.fromJson(core.Map _json) { |
| 1084 if (_json.containsKey("devices")) { |
| 1085 devices = _json["devices"].map((value) => new Device.fromJson(value)).toLi
st(); |
| 1086 } |
| 1087 if (_json.containsKey("nextPageToken")) { |
| 1088 nextPageToken = _json["nextPageToken"]; |
| 1089 } |
| 1090 } |
| 1091 |
| 1092 core.Map<core.String, core.Object> toJson() { |
| 1093 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1094 if (devices != null) { |
| 1095 _json["devices"] = devices.map((value) => (value).toJson()).toList(); |
| 1096 } |
| 1097 if (nextPageToken != null) { |
| 1098 _json["nextPageToken"] = nextPageToken; |
| 1099 } |
| 1100 return _json; |
| 1101 } |
| 1102 } |
| 1103 |
| 1104 /** Response message of all customers related to this partner. */ |
| 1105 class ListCustomersResponse { |
| 1106 /** List of customers related to this partner. */ |
| 1107 core.List<Company> customers; |
| 1108 |
| 1109 ListCustomersResponse(); |
| 1110 |
| 1111 ListCustomersResponse.fromJson(core.Map _json) { |
| 1112 if (_json.containsKey("customers")) { |
| 1113 customers = _json["customers"].map((value) => new Company.fromJson(value))
.toList(); |
| 1114 } |
| 1115 } |
| 1116 |
| 1117 core.Map<core.String, core.Object> toJson() { |
| 1118 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1119 if (customers != null) { |
| 1120 _json["customers"] = customers.map((value) => (value).toJson()).toList(); |
| 1121 } |
| 1122 return _json; |
| 1123 } |
| 1124 } |
| 1125 |
| 1126 /** |
| 1127 * This resource represents a long-running operation that is the result of a |
| 1128 * network API call. |
| 1129 */ |
| 1130 class Operation { |
| 1131 /** |
| 1132 * If the value is `false`, it means the operation is still in progress. |
| 1133 * If true, the operation is completed, and either `error` or `response` is |
| 1134 * available. |
| 1135 */ |
| 1136 core.bool done; |
| 1137 /** |
| 1138 * This field will always be not set if the operation is created by |
| 1139 * `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, error |
| 1140 * information for each device is set in |
| 1141 * `response.perDeviceStatus.result.status`. |
| 1142 */ |
| 1143 Status error; |
| 1144 /** |
| 1145 * This field will contain a `DevicesLongRunningOperationMetadata` object if |
| 1146 * the operation is created by `claimAsync`, `unclaimAsync`, or |
| 1147 * `updateMetadataAsync`. |
| 1148 * |
| 1149 * The values for Object must be JSON objects. It can consist of `num`, |
| 1150 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1151 */ |
| 1152 core.Map<core.String, core.Object> metadata; |
| 1153 /** |
| 1154 * The server-assigned name, which is only unique within the same service that |
| 1155 * originally returns it. If you use the default HTTP mapping, the |
| 1156 * `name` should have the format of `operations/some/unique/name`. |
| 1157 */ |
| 1158 core.String name; |
| 1159 /** |
| 1160 * This field will contain a `DevicesLongRunningOperationResponse` object if |
| 1161 * the operation is created by `claimAsync`, `unclaimAsync`, or |
| 1162 * `updateMetadataAsync`. |
| 1163 * |
| 1164 * The values for Object must be JSON objects. It can consist of `num`, |
| 1165 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1166 */ |
| 1167 core.Map<core.String, core.Object> response; |
| 1168 |
| 1169 Operation(); |
| 1170 |
| 1171 Operation.fromJson(core.Map _json) { |
| 1172 if (_json.containsKey("done")) { |
| 1173 done = _json["done"]; |
| 1174 } |
| 1175 if (_json.containsKey("error")) { |
| 1176 error = new Status.fromJson(_json["error"]); |
| 1177 } |
| 1178 if (_json.containsKey("metadata")) { |
| 1179 metadata = _json["metadata"]; |
| 1180 } |
| 1181 if (_json.containsKey("name")) { |
| 1182 name = _json["name"]; |
| 1183 } |
| 1184 if (_json.containsKey("response")) { |
| 1185 response = _json["response"]; |
| 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 (done != null) { |
| 1192 _json["done"] = done; |
| 1193 } |
| 1194 if (error != null) { |
| 1195 _json["error"] = (error).toJson(); |
| 1196 } |
| 1197 if (metadata != null) { |
| 1198 _json["metadata"] = metadata; |
| 1199 } |
| 1200 if (name != null) { |
| 1201 _json["name"] = name; |
| 1202 } |
| 1203 if (response != null) { |
| 1204 _json["response"] = response; |
| 1205 } |
| 1206 return _json; |
| 1207 } |
| 1208 } |
| 1209 |
| 1210 /** Operation the server received for every device. */ |
| 1211 class OperationPerDevice { |
| 1212 /** Request to claim a device. */ |
| 1213 PartnerClaim claim; |
| 1214 /** Processing result for every device. */ |
| 1215 PerDeviceStatusInBatch result; |
| 1216 /** Request to unclaim a device. */ |
| 1217 PartnerUnclaim unclaim; |
| 1218 /** Request to set metadata for a device. */ |
| 1219 UpdateMetadataArguments updateMetadata; |
| 1220 |
| 1221 OperationPerDevice(); |
| 1222 |
| 1223 OperationPerDevice.fromJson(core.Map _json) { |
| 1224 if (_json.containsKey("claim")) { |
| 1225 claim = new PartnerClaim.fromJson(_json["claim"]); |
| 1226 } |
| 1227 if (_json.containsKey("result")) { |
| 1228 result = new PerDeviceStatusInBatch.fromJson(_json["result"]); |
| 1229 } |
| 1230 if (_json.containsKey("unclaim")) { |
| 1231 unclaim = new PartnerUnclaim.fromJson(_json["unclaim"]); |
| 1232 } |
| 1233 if (_json.containsKey("updateMetadata")) { |
| 1234 updateMetadata = new UpdateMetadataArguments.fromJson(_json["updateMetadat
a"]); |
| 1235 } |
| 1236 } |
| 1237 |
| 1238 core.Map<core.String, core.Object> toJson() { |
| 1239 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1240 if (claim != null) { |
| 1241 _json["claim"] = (claim).toJson(); |
| 1242 } |
| 1243 if (result != null) { |
| 1244 _json["result"] = (result).toJson(); |
| 1245 } |
| 1246 if (unclaim != null) { |
| 1247 _json["unclaim"] = (unclaim).toJson(); |
| 1248 } |
| 1249 if (updateMetadata != null) { |
| 1250 _json["updateMetadata"] = (updateMetadata).toJson(); |
| 1251 } |
| 1252 return _json; |
| 1253 } |
| 1254 } |
| 1255 |
| 1256 /** Identifies one claim request. */ |
| 1257 class PartnerClaim { |
| 1258 /** customer id to claim for. */ |
| 1259 core.String customerId; |
| 1260 /** Device identifier of the device. */ |
| 1261 DeviceIdentifier deviceIdentifier; |
| 1262 /** metadata to set at claim. */ |
| 1263 DeviceMetadata deviceMetadata; |
| 1264 /** |
| 1265 * section type to claim. |
| 1266 * Possible string values are: |
| 1267 * - "SECTION_TYPE_UNSPECIFIED" : Unspecified |
| 1268 * - "SECTION_TYPE_ZERO_TOUCH" : Zero touch |
| 1269 */ |
| 1270 core.String sectionType; |
| 1271 |
| 1272 PartnerClaim(); |
| 1273 |
| 1274 PartnerClaim.fromJson(core.Map _json) { |
| 1275 if (_json.containsKey("customerId")) { |
| 1276 customerId = _json["customerId"]; |
| 1277 } |
| 1278 if (_json.containsKey("deviceIdentifier")) { |
| 1279 deviceIdentifier = new DeviceIdentifier.fromJson(_json["deviceIdentifier"]
); |
| 1280 } |
| 1281 if (_json.containsKey("deviceMetadata")) { |
| 1282 deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]); |
| 1283 } |
| 1284 if (_json.containsKey("sectionType")) { |
| 1285 sectionType = _json["sectionType"]; |
| 1286 } |
| 1287 } |
| 1288 |
| 1289 core.Map<core.String, core.Object> toJson() { |
| 1290 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1291 if (customerId != null) { |
| 1292 _json["customerId"] = customerId; |
| 1293 } |
| 1294 if (deviceIdentifier != null) { |
| 1295 _json["deviceIdentifier"] = (deviceIdentifier).toJson(); |
| 1296 } |
| 1297 if (deviceMetadata != null) { |
| 1298 _json["deviceMetadata"] = (deviceMetadata).toJson(); |
| 1299 } |
| 1300 if (sectionType != null) { |
| 1301 _json["sectionType"] = sectionType; |
| 1302 } |
| 1303 return _json; |
| 1304 } |
| 1305 } |
| 1306 |
| 1307 /** Identifies one unclaim request. */ |
| 1308 class PartnerUnclaim { |
| 1309 /** device id of the device. */ |
| 1310 core.String deviceId; |
| 1311 /** device identifier of the device. */ |
| 1312 DeviceIdentifier deviceIdentifier; |
| 1313 /** |
| 1314 * section type to unclaim. |
| 1315 * Possible string values are: |
| 1316 * - "SECTION_TYPE_UNSPECIFIED" : Unspecified |
| 1317 * - "SECTION_TYPE_ZERO_TOUCH" : Zero touch |
| 1318 */ |
| 1319 core.String sectionType; |
| 1320 |
| 1321 PartnerUnclaim(); |
| 1322 |
| 1323 PartnerUnclaim.fromJson(core.Map _json) { |
| 1324 if (_json.containsKey("deviceId")) { |
| 1325 deviceId = _json["deviceId"]; |
| 1326 } |
| 1327 if (_json.containsKey("deviceIdentifier")) { |
| 1328 deviceIdentifier = new DeviceIdentifier.fromJson(_json["deviceIdentifier"]
); |
| 1329 } |
| 1330 if (_json.containsKey("sectionType")) { |
| 1331 sectionType = _json["sectionType"]; |
| 1332 } |
| 1333 } |
| 1334 |
| 1335 core.Map<core.String, core.Object> toJson() { |
| 1336 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1337 if (deviceId != null) { |
| 1338 _json["deviceId"] = deviceId; |
| 1339 } |
| 1340 if (deviceIdentifier != null) { |
| 1341 _json["deviceIdentifier"] = (deviceIdentifier).toJson(); |
| 1342 } |
| 1343 if (sectionType != null) { |
| 1344 _json["sectionType"] = sectionType; |
| 1345 } |
| 1346 return _json; |
| 1347 } |
| 1348 } |
| 1349 |
| 1350 /** Stores the processing result for each device. */ |
| 1351 class PerDeviceStatusInBatch { |
| 1352 /** device id of the device if process succeeds. */ |
| 1353 core.String deviceId; |
| 1354 /** Error identifier. */ |
| 1355 core.String errorIdentifier; |
| 1356 /** Error message */ |
| 1357 core.String errorMessage; |
| 1358 /** |
| 1359 * Process result. |
| 1360 * Possible string values are: |
| 1361 * - "SINGLE_DEVICE_STATUS_UNSPECIFIED" : Invalid code. Shouldn' be used. |
| 1362 * - "SINGLE_DEVICE_STATUS_UNKNOWN_ERROR" : Unknown error. |
| 1363 * Unknown error is we don't expect it here. |
| 1364 * - "SINGLE_DEVICE_STATUS_OTHER_ERROR" : Other error. |
| 1365 * Other error is we know/expect this error, but not having proper error |
| 1366 * code yet. |
| 1367 * - "SINGLE_DEVICE_STATUS_SUCCESS" : Success. |
| 1368 * - "SINGLE_DEVICE_STATUS_PERMISSION_DENIED" : Permission denied |
| 1369 * - "SINGLE_DEVICE_STATUS_INVALID_DEVICE_IDENTIFIER" : Invalid device |
| 1370 * identifier. |
| 1371 * - "SINGLE_DEVICE_STATUS_INVALID_SECTION_TYPE" : Invalid section type. |
| 1372 * - "SINGLE_DEVICE_STATUS_SECTION_NOT_YOURS" : This section is claimed by |
| 1373 * other company. |
| 1374 */ |
| 1375 core.String status; |
| 1376 |
| 1377 PerDeviceStatusInBatch(); |
| 1378 |
| 1379 PerDeviceStatusInBatch.fromJson(core.Map _json) { |
| 1380 if (_json.containsKey("deviceId")) { |
| 1381 deviceId = _json["deviceId"]; |
| 1382 } |
| 1383 if (_json.containsKey("errorIdentifier")) { |
| 1384 errorIdentifier = _json["errorIdentifier"]; |
| 1385 } |
| 1386 if (_json.containsKey("errorMessage")) { |
| 1387 errorMessage = _json["errorMessage"]; |
| 1388 } |
| 1389 if (_json.containsKey("status")) { |
| 1390 status = _json["status"]; |
| 1391 } |
| 1392 } |
| 1393 |
| 1394 core.Map<core.String, core.Object> toJson() { |
| 1395 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1396 if (deviceId != null) { |
| 1397 _json["deviceId"] = deviceId; |
| 1398 } |
| 1399 if (errorIdentifier != null) { |
| 1400 _json["errorIdentifier"] = errorIdentifier; |
| 1401 } |
| 1402 if (errorMessage != null) { |
| 1403 _json["errorMessage"] = errorMessage; |
| 1404 } |
| 1405 if (status != null) { |
| 1406 _json["status"] = status; |
| 1407 } |
| 1408 return _json; |
| 1409 } |
| 1410 } |
| 1411 |
| 1412 /** |
| 1413 * The `Status` type defines a logical error model that is suitable for |
| 1414 * different |
| 1415 * programming environments, including REST APIs and RPC APIs. It is used by |
| 1416 * [gRPC](https://github.com/grpc). The error model is designed to be: |
| 1417 * |
| 1418 * - Simple to use and understand for most users |
| 1419 * - Flexible enough to meet unexpected needs |
| 1420 * |
| 1421 * # Overview |
| 1422 * |
| 1423 * The `Status` message contains three pieces of data: error code, error |
| 1424 * message, |
| 1425 * and error details. The error code should be an enum value of |
| 1426 * google.rpc.Code, but it may accept additional error codes if needed. The |
| 1427 * error message should be a developer-facing English message that helps |
| 1428 * developers *understand* and *resolve* the error. If a localized user-facing |
| 1429 * error message is needed, put the localized message in the error details or |
| 1430 * localize it in the client. The optional error details may contain arbitrary |
| 1431 * information about the error. There is a predefined set of error detail types |
| 1432 * in the package `google.rpc` that can be used for common error conditions. |
| 1433 * |
| 1434 * # Language mapping |
| 1435 * |
| 1436 * The `Status` message is the logical representation of the error model, but it |
| 1437 * is not necessarily the actual wire format. When the `Status` message is |
| 1438 * exposed in different client libraries and different wire protocols, it can be |
| 1439 * mapped differently. For example, it will likely be mapped to some exceptions |
| 1440 * in Java, but more likely mapped to some error codes in C. |
| 1441 * |
| 1442 * # Other uses |
| 1443 * |
| 1444 * The error model and the `Status` message can be used in a variety of |
| 1445 * environments, either with or without APIs, to provide a |
| 1446 * consistent developer experience across different environments. |
| 1447 * |
| 1448 * Example uses of this error model include: |
| 1449 * |
| 1450 * - Partial errors. If a service needs to return partial errors to the client, |
| 1451 * it may embed the `Status` in the normal response to indicate the partial |
| 1452 * errors. |
| 1453 * |
| 1454 * - Workflow errors. A typical workflow has multiple steps. Each step may |
| 1455 * have a `Status` message for error reporting. |
| 1456 * |
| 1457 * - Batch operations. If a client uses batch request and batch response, the |
| 1458 * `Status` message should be used directly inside batch response, one for |
| 1459 * each error sub-response. |
| 1460 * |
| 1461 * - Asynchronous operations. If an API call embeds asynchronous operation |
| 1462 * results in its response, the status of those operations should be |
| 1463 * represented directly using the `Status` message. |
| 1464 * |
| 1465 * - Logging. If some API errors are stored in logs, the message `Status` could |
| 1466 * be used directly after any stripping needed for security/privacy reasons. |
| 1467 */ |
| 1468 class Status { |
| 1469 /** The status code, which should be an enum value of google.rpc.Code. */ |
| 1470 core.int code; |
| 1471 /** |
| 1472 * A list of messages that carry the error details. There is a common set of |
| 1473 * message types for APIs to use. |
| 1474 * |
| 1475 * The values for Object must be JSON objects. It can consist of `num`, |
| 1476 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1477 */ |
| 1478 core.List<core.Map<core.String, core.Object>> details; |
| 1479 /** |
| 1480 * A developer-facing error message, which should be in English. Any |
| 1481 * user-facing error message should be localized and sent in the |
| 1482 * google.rpc.Status.details field, or localized by the client. |
| 1483 */ |
| 1484 core.String message; |
| 1485 |
| 1486 Status(); |
| 1487 |
| 1488 Status.fromJson(core.Map _json) { |
| 1489 if (_json.containsKey("code")) { |
| 1490 code = _json["code"]; |
| 1491 } |
| 1492 if (_json.containsKey("details")) { |
| 1493 details = _json["details"]; |
| 1494 } |
| 1495 if (_json.containsKey("message")) { |
| 1496 message = _json["message"]; |
| 1497 } |
| 1498 } |
| 1499 |
| 1500 core.Map<core.String, core.Object> toJson() { |
| 1501 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1502 if (code != null) { |
| 1503 _json["code"] = code; |
| 1504 } |
| 1505 if (details != null) { |
| 1506 _json["details"] = details; |
| 1507 } |
| 1508 if (message != null) { |
| 1509 _json["message"] = message; |
| 1510 } |
| 1511 return _json; |
| 1512 } |
| 1513 } |
| 1514 |
| 1515 /** Request message to unclaim a device. */ |
| 1516 class UnclaimDeviceRequest { |
| 1517 /** The device id returned by ClaimDevice. */ |
| 1518 core.String deviceId; |
| 1519 /** The device identifier you use when you claimed this device. */ |
| 1520 DeviceIdentifier deviceIdentifier; |
| 1521 /** |
| 1522 * The section type to unclaim for. |
| 1523 * Possible string values are: |
| 1524 * - "SECTION_TYPE_UNSPECIFIED" : Unspecified |
| 1525 * - "SECTION_TYPE_ZERO_TOUCH" : Zero touch |
| 1526 */ |
| 1527 core.String sectionType; |
| 1528 |
| 1529 UnclaimDeviceRequest(); |
| 1530 |
| 1531 UnclaimDeviceRequest.fromJson(core.Map _json) { |
| 1532 if (_json.containsKey("deviceId")) { |
| 1533 deviceId = _json["deviceId"]; |
| 1534 } |
| 1535 if (_json.containsKey("deviceIdentifier")) { |
| 1536 deviceIdentifier = new DeviceIdentifier.fromJson(_json["deviceIdentifier"]
); |
| 1537 } |
| 1538 if (_json.containsKey("sectionType")) { |
| 1539 sectionType = _json["sectionType"]; |
| 1540 } |
| 1541 } |
| 1542 |
| 1543 core.Map<core.String, core.Object> toJson() { |
| 1544 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1545 if (deviceId != null) { |
| 1546 _json["deviceId"] = deviceId; |
| 1547 } |
| 1548 if (deviceIdentifier != null) { |
| 1549 _json["deviceIdentifier"] = (deviceIdentifier).toJson(); |
| 1550 } |
| 1551 if (sectionType != null) { |
| 1552 _json["sectionType"] = sectionType; |
| 1553 } |
| 1554 return _json; |
| 1555 } |
| 1556 } |
| 1557 |
| 1558 /** Request to unclaim devices asynchronously in batch. */ |
| 1559 class UnclaimDevicesRequest { |
| 1560 /** list of unclaims. */ |
| 1561 core.List<PartnerUnclaim> unclaims; |
| 1562 |
| 1563 UnclaimDevicesRequest(); |
| 1564 |
| 1565 UnclaimDevicesRequest.fromJson(core.Map _json) { |
| 1566 if (_json.containsKey("unclaims")) { |
| 1567 unclaims = _json["unclaims"].map((value) => new PartnerUnclaim.fromJson(va
lue)).toList(); |
| 1568 } |
| 1569 } |
| 1570 |
| 1571 core.Map<core.String, core.Object> toJson() { |
| 1572 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1573 if (unclaims != null) { |
| 1574 _json["unclaims"] = unclaims.map((value) => (value).toJson()).toList(); |
| 1575 } |
| 1576 return _json; |
| 1577 } |
| 1578 } |
| 1579 |
| 1580 /** Request to update device metadata in batch. */ |
| 1581 class UpdateDeviceMetadataInBatchRequest { |
| 1582 /** list of metadata updates. */ |
| 1583 core.List<UpdateMetadataArguments> updates; |
| 1584 |
| 1585 UpdateDeviceMetadataInBatchRequest(); |
| 1586 |
| 1587 UpdateDeviceMetadataInBatchRequest.fromJson(core.Map _json) { |
| 1588 if (_json.containsKey("updates")) { |
| 1589 updates = _json["updates"].map((value) => new UpdateMetadataArguments.from
Json(value)).toList(); |
| 1590 } |
| 1591 } |
| 1592 |
| 1593 core.Map<core.String, core.Object> toJson() { |
| 1594 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1595 if (updates != null) { |
| 1596 _json["updates"] = updates.map((value) => (value).toJson()).toList(); |
| 1597 } |
| 1598 return _json; |
| 1599 } |
| 1600 } |
| 1601 |
| 1602 /** Request to set metadata for a device. */ |
| 1603 class UpdateDeviceMetadataRequest { |
| 1604 /** The metdata to set. */ |
| 1605 DeviceMetadata deviceMetadata; |
| 1606 |
| 1607 UpdateDeviceMetadataRequest(); |
| 1608 |
| 1609 UpdateDeviceMetadataRequest.fromJson(core.Map _json) { |
| 1610 if (_json.containsKey("deviceMetadata")) { |
| 1611 deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]); |
| 1612 } |
| 1613 } |
| 1614 |
| 1615 core.Map<core.String, core.Object> toJson() { |
| 1616 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1617 if (deviceMetadata != null) { |
| 1618 _json["deviceMetadata"] = (deviceMetadata).toJson(); |
| 1619 } |
| 1620 return _json; |
| 1621 } |
| 1622 } |
| 1623 |
| 1624 /** Identifies metdata updates to one device. */ |
| 1625 class UpdateMetadataArguments { |
| 1626 /** device id of the device. */ |
| 1627 core.String deviceId; |
| 1628 /** device identifier. */ |
| 1629 DeviceIdentifier deviceIdentifier; |
| 1630 /** The metadata to update. */ |
| 1631 DeviceMetadata deviceMetadata; |
| 1632 |
| 1633 UpdateMetadataArguments(); |
| 1634 |
| 1635 UpdateMetadataArguments.fromJson(core.Map _json) { |
| 1636 if (_json.containsKey("deviceId")) { |
| 1637 deviceId = _json["deviceId"]; |
| 1638 } |
| 1639 if (_json.containsKey("deviceIdentifier")) { |
| 1640 deviceIdentifier = new DeviceIdentifier.fromJson(_json["deviceIdentifier"]
); |
| 1641 } |
| 1642 if (_json.containsKey("deviceMetadata")) { |
| 1643 deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]); |
| 1644 } |
| 1645 } |
| 1646 |
| 1647 core.Map<core.String, core.Object> toJson() { |
| 1648 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1649 if (deviceId != null) { |
| 1650 _json["deviceId"] = deviceId; |
| 1651 } |
| 1652 if (deviceIdentifier != null) { |
| 1653 _json["deviceIdentifier"] = (deviceIdentifier).toJson(); |
| 1654 } |
| 1655 if (deviceMetadata != null) { |
| 1656 _json["deviceMetadata"] = (deviceMetadata).toJson(); |
| 1657 } |
| 1658 return _json; |
| 1659 } |
| 1660 } |
OLD | NEW |