/
v1.ts
3244 lines (3026 loc) · 115 KB
/
v1.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {AxiosPromise} from 'axios';
import {Compute, JWT, OAuth2Client, UserRefreshClient} from 'google-auth-library';
import {BodyResponseCallback, createAPIRequest, GlobalOptions, GoogleConfigurable, MethodOptions} from 'googleapis-common';
// tslint:disable: no-any
// tslint:disable: class-name
// tslint:disable: variable-name
// tslint:disable: jsdoc-format
// tslint:disable: no-namespace
export namespace androiddeviceprovisioning_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
/**
* Android Device Provisioning Partner API
*
* Automates Android zero-touch enrollment for device resellers, customers,
* and EMMs.
*
* @example
* const {google} = require('googleapis');
* const androiddeviceprovisioning = google.androiddeviceprovisioning('v1');
*
* @namespace androiddeviceprovisioning
* @type {Function}
* @version v1
* @variation v1
* @param {object=} options Options for Androiddeviceprovisioning
*/
export class Androiddeviceprovisioning {
_options: GlobalOptions;
google?: GoogleConfigurable;
root = this;
customers: Resource$Customers;
operations: Resource$Operations;
partners: Resource$Partners;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this._options = options || {};
this.google = google;
this.getRoot.bind(this);
this.customers = new Resource$Customers(this);
this.operations = new Resource$Operations(this);
this.partners = new Resource$Partners(this);
}
getRoot() {
return this.root;
}
}
/**
* Request message to claim a device on behalf of a customer.
*/
export interface Schema$ClaimDeviceRequest {
/**
* Required. The ID of the customer for whom the device is being claimed.
*/
customerId?: string;
/**
* Required. The device identifier of the device to claim.
*/
deviceIdentifier?: Schema$DeviceIdentifier;
/**
* Required. The section type of the device's provisioning record.
*/
sectionType?: string;
}
/**
* Response message containing device id of the claim.
*/
export interface Schema$ClaimDeviceResponse {
/**
* The device ID of the claimed device.
*/
deviceId?: string;
/**
* The resource name of the device in the format
* `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.
*/
deviceName?: string;
}
/**
* Request to claim devices asynchronously in batch. Claiming a device adds
* the device to zero-touch enrollment and shows the device in the
* customer's view of the portal.
*/
export interface Schema$ClaimDevicesRequest {
/**
* Required. A list of device claims.
*/
claims?: Schema$PartnerClaim[];
}
/**
* A customer resource in the zero-touch enrollment API.
*/
export interface Schema$Company {
/**
* Input only. Optional. Email address of customer's users in the admin
* role. Each email address must be associated with a Google Account.
*/
adminEmails?: string[];
/**
* Output only. The ID of the company. Assigned by the server.
*/
companyId?: string;
/**
* Required. The name of the company. For example _XYZ Corp_. Displayed to
* the customer's employees in the zero-touch enrollment portal.
*/
companyName?: string;
/**
* Output only. The API resource name of the company in the format
* `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server.
*/
name?: string;
/**
* Input only. Email address of customer's users in the owner role. At
* least one `owner_email` is required. Each email address must be
* associated with a Google Account. Owners share the same access as admins
* but can also add, delete, and edit your organization's portal users.
*/
ownerEmails?: string[];
/**
* Output only. Whether any user from the company has accepted the latest
* Terms of Service (ToS). See TermsStatus.
*/
termsStatus?: string;
}
/**
* A configuration collects the provisioning options for Android devices. Each
* configuration combines the following: * The EMM device policy controller
* (DPC) installed on the devices. * EMM policies enforced on the devices. *
* Metadata displayed on the device to help users during setup. Customers can
* add as many configurations as they need. However, zero-touch enrollment
* works best when a customer sets a default configuration that's applied
* to any new devices the organization purchases.
*/
export interface Schema$Configuration {
/**
* Required. The name of the organization. Zero-touch enrollment shows this
* organization name to device users during device provisioning.
*/
companyName?: string;
/**
* Output only. The ID of the configuration. Assigned by the server.
*/
configurationId?: string;
/**
* Required. A short name that describes the configuration's purpose.
* For example, _Sales team_ or _Temporary employees_. The zero-touch
* enrollment portal displays this name to IT admins.
*/
configurationName?: string;
/**
* Required. The email address that device users can contact to get help.
* Zero-touch enrollment shows this email address to device users before
* device provisioning. The value is validated on input.
*/
contactEmail?: string;
/**
* Required. The telephone number that device users can call, using another
* device, to get help. Zero-touch enrollment shows this number to device
* users before device provisioning. Accepts numerals, spaces, the plus
* sign, hyphens, and parentheses.
*/
contactPhone?: string;
/**
* A message, containing one or two sentences, to help device users get help
* or give them more details about what’s happening to their device.
* Zero-touch enrollment shows this message before the device is
* provisioned.
*/
customMessage?: string;
/**
* The JSON-formatted EMM provisioning extras that are passed to the DPC.
*/
dpcExtras?: string;
/**
* Required. The resource name of the selected DPC (device policy
* controller) in the format `customers/[CUSTOMER_ID]/dpcs/x. To list the
* supported DPCs, call `customers.dpcs.list`.
*/
dpcResourcePath?: string;
/**
* Required. Whether this is the default configuration that zero-touch
* enrollment applies to any new devices the organization purchases in the
* future. Only one customer configuration can be the default. Setting this
* value to `true`, changes the previous default configuration's
* `isDefault` value to `false`.
*/
isDefault?: boolean;
/**
* Output only. The API resource name in the format
* `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned by
* the server.
*/
name?: string;
}
/**
* Request message to create a customer.
*/
export interface Schema$CreateCustomerRequest {
/**
* Required. The company data to populate the new customer. Must contain a
* value for `companyName` and at least one `owner_email` that's
* associated with a Google Account. The values for `companyId` and `name`
* must be empty.
*/
customer?: Schema$Company;
}
/**
* Request message for customer to assign a configuration to device.
*/
export interface Schema$CustomerApplyConfigurationRequest {
/**
* Required. The configuration applied to the device in the format
* `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`.
*/
configuration?: string;
/**
* Required. The device the configuration is applied to.
*/
device?: Schema$DeviceReference;
}
/**
* Response message of customer's listing configuration.
*/
export interface Schema$CustomerListConfigurationsResponse {
/**
* The configurations.
*/
configurations?: Schema$Configuration[];
}
/**
* Response message for listing my customers.
*/
export interface Schema$CustomerListCustomersResponse {
/**
* The customer accounts the calling user is a member of.
*/
customers?: Schema$Company[];
/**
* A token used to access the next page of results. Omitted if no further
* results are available.
*/
nextPageToken?: string;
}
/**
* Response message of customer's liting devices.
*/
export interface Schema$CustomerListDevicesResponse {
/**
* The customer's devices.
*/
devices?: Schema$Device[];
/**
* A token used to access the next page of results. Omitted if no further
* results are available.
*/
nextPageToken?: string;
}
/**
* Response message of customer's listing DPCs.
*/
export interface Schema$CustomerListDpcsResponse {
/**
* The list of DPCs available to the customer that support zero-touch
* enrollment.
*/
dpcs?: Schema$Dpc[];
}
/**
* Request message for customer to remove the configuration from device.
*/
export interface Schema$CustomerRemoveConfigurationRequest {
/**
* Required. The device to remove the configuration from.
*/
device?: Schema$DeviceReference;
}
/**
* Request message for customer to unclaim a device.
*/
export interface Schema$CustomerUnclaimDeviceRequest {
/**
* Required. The device to unclaim.
*/
device?: Schema$DeviceReference;
}
/**
* An Android device registered for zero-touch enrollment.
*/
export interface Schema$Device {
/**
* Output only. The provisioning claims for a device. Devices claimed for
* zero-touch enrollment have a claim with the type
* `SECTION_TYPE_ZERO_TOUCH`. Call `partners.devices.unclaim` or
* `partners.devices.unclaimAsync` to remove the device from zero-touch
* enrollment.
*/
claims?: Schema$DeviceClaim[];
/**
* Not available to resellers.
*/
configuration?: string;
/**
* Output only. The ID of the device. Assigned by the server.
*/
deviceId?: string;
/**
* The hardware IDs that identify a manufactured device. To learn more, read
* [Identifiers](/zero-touch/guides/identifiers).
*/
deviceIdentifier?: Schema$DeviceIdentifier;
/**
* The metadata attached to the device. Structured as key-value pairs. To
* learn more, read [Device metadata](/zero-touch/guides/metadata).
*/
deviceMetadata?: Schema$DeviceMetadata;
/**
* Output only. The API resource name in the format
* `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. Assigned by the server.
*/
name?: string;
}
/**
* A record of a device claimed by a reseller for a customer. Devices claimed
* for zero-touch enrollment have a claim with the type
* `SECTION_TYPE_ZERO_TOUCH`. To learn more, read [Claim devices for
* customers](/zero-touch/guides/how-it-works#claim).
*/
export interface Schema$DeviceClaim {
/**
* The ID of the Customer that purchased the device.
*/
ownerCompanyId?: string;
/**
* The ID of the reseller that claimed the device.
*/
resellerId?: string;
/**
* Output only. The type of claim made on the device.
*/
sectionType?: string;
}
/**
* Encapsulates hardware and product IDs to identify a manufactured device. To
* learn more, read [Identifiers](/zero-touch/guides/identifiers).
*/
export interface Schema$DeviceIdentifier {
/**
* The device’s IMEI number. Validated on input.
*/
imei?: string;
/**
* Required. The device manufacturer’s name. Matches the device's
* built-in value returned from `android.os.Build.MANUFACTURER`. Allowed
* values are listed in [manufacturer
* names](/zero-touch/resources/manufacturer-names).
*/
manufacturer?: string;
/**
* The device’s MEID number.
*/
meid?: string;
/**
* The manufacturer's serial number for the device. This value might not
* be unique.
*/
serialNumber?: string;
}
/**
* Metadata entries that can be attached to a `Device`. To learn more, read
* [Device metadata](/zero-touch/guides/metadata).
*/
export interface Schema$DeviceMetadata {
/**
* Metadata entries recorded as key-value pairs.
*/
entries?: any;
}
/**
* A `DeviceReference` is an API abstraction that lets you supply a _device_
* argument to a method using one of the following identifier types: * A
* numeric API resource ID. * Real-world hardware IDs, such as IMEI number,
* belonging to the manufactured device. Methods that operate on devices
* take a `DeviceReference` as a parameter type because it's more flexible
* for the caller. To learn more about device identifiers, read
* [Identifiers](/zero-touch/guides/identifiers).
*/
export interface Schema$DeviceReference {
/**
* The ID of the device.
*/
deviceId?: string;
/**
* The hardware IDs of the device.
*/
deviceIdentifier?: Schema$DeviceIdentifier;
}
/**
* Tracks the status of a long-running operation to asynchronously update a
* batch of reseller metadata attached to devices. To learn more, read
* [Long‑running batch
* operations](/zero-touch/guides/how-it-works#operations).
*/
export interface Schema$DevicesLongRunningOperationMetadata {
/**
* The number of metadata updates in the operation. This might be different
* from the number of updates in the request if the API can't parse some
* of the updates.
*/
devicesCount?: number;
/**
* The processing status of the operation.
*/
processingStatus?: string;
/**
* The processing progress of the operation. Measured as a number from 0 to
* 100. A value of 10O doesnt always mean the operation completed—check for
* the inclusion of a `done` field.
*/
progress?: number;
}
/**
* Tracks the status of a long-running operation to claim, unclaim, or attach
* metadata to devices. To learn more, read [Long‑running batch
* operations](/zero-touch/guides/how-it-works#operations).
*/
export interface Schema$DevicesLongRunningOperationResponse {
/**
* The processing status for each device in the operation. One
* `PerDeviceStatus` per device. The list order matches the items in the
* original request.
*/
perDeviceStatus?: Schema$OperationPerDevice[];
/**
* A summary of how many items in the operation the server processed
* successfully. Updated as the operation progresses.
*/
successCount?: number;
}
/**
* An EMM's DPC ([device policy
* controller](http://developer.android.com/work/dpc/build-dpc.html)).
* Zero-touch enrollment installs a DPC (listed in the `Configuration`) on a
* device to maintain the customer's mobile policies. All the DPCs listed
* by the API support zero-touch enrollment and are available in Google Play.
*/
export interface Schema$Dpc {
/**
* Output only. The title of the DPC app in Google Play. For example,
* _Google Apps Device Policy_. Useful in an application's user
* interface.
*/
dpcName?: string;
/**
* Output only. The API resource name in the format
* `customers/[CUSTOMER_ID]/dpcs/[DPC_ID]`. Assigned by the server. To
* maintain a reference to a DPC across customer accounts, persist and match
* the last path component (`DPC_ID`).
*/
name?: string;
/**
* Output only. The DPC's Android application ID that looks like a Java
* package name. Zero-touch enrollment installs the DPC app onto a device
* using this identifier.
*/
packageName?: string;
}
/**
* A generic empty message that you can re-use to avoid defining duplicated
* empty messages in your APIs. A typical example is to use it as the request
* or the response type of an API method. For instance: service Foo { rpc
* Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON
* representation for `Empty` is empty JSON object `{}`.
*/
export interface Schema$Empty {}
/**
* Request to find devices.
*/
export interface Schema$FindDevicesByDeviceIdentifierRequest {
/**
* Required. The device identifier to search for.
*/
deviceIdentifier?: Schema$DeviceIdentifier;
/**
* Required. The maximum number of devices to show in a page of results.
* Must be between 1 and 100 inclusive.
*/
limit?: string;
/**
* A token specifying which result page to return.
*/
pageToken?: string;
}
/**
* Response containing found devices.
*/
export interface Schema$FindDevicesByDeviceIdentifierResponse {
/**
* Found devices.
*/
devices?: Schema$Device[];
/**
* A token used to access the next page of results. Omitted if no further
* results are available.
*/
nextPageToken?: string;
}
/**
* Request to find devices by customers.
*/
export interface Schema$FindDevicesByOwnerRequest {
/**
* Required. The list of customer IDs to search for.
*/
customerId?: string[];
/**
* Required. The maximum number of devices to show in a page of results.
* Must be between 1 and 100 inclusive.
*/
limit?: string;
/**
* A token specifying which result page to return.
*/
pageToken?: string;
/**
* Required. The section type of the device's provisioning record.
*/
sectionType?: string;
}
/**
* Response containing found devices.
*/
export interface Schema$FindDevicesByOwnerResponse {
/**
* The customer's devices.
*/
devices?: Schema$Device[];
/**
* A token used to access the next page of results. Omitted if no further
* results are available.
*/
nextPageToken?: string;
}
/**
* Response message of all customers related to this partner.
*/
export interface Schema$ListCustomersResponse {
/**
* List of customers related to this reseller partner.
*/
customers?: Schema$Company[];
}
/**
* Response message to list customers of the vendor.
*/
export interface Schema$ListVendorCustomersResponse {
/**
* List of customers of the vendor.
*/
customers?: Schema$Company[];
/**
* A token to retrieve the next page of results. Omitted if no further
* results are available.
*/
nextPageToken?: string;
}
/**
* Response message to list vendors of the partner.
*/
export interface Schema$ListVendorsResponse {
/**
* A token to retrieve the next page of results. Omitted if no further
* results are available.
*/
nextPageToken?: string;
/**
* List of vendors of the reseller partner. Fields `name`, `companyId` and
* `companyName` are populated to the Company object.
*/
vendors?: Schema$Company[];
}
/**
* This resource represents a long-running operation that is the result of a
* network API call.
*/
export interface Schema$Operation {
/**
* If the value is `false`, it means the operation is still in progress. If
* `true`, the operation is completed, and either `error` or `response` is
* available.
*/
done?: boolean;
/**
* This field will always be not set if the operation is created by
* `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case,
* error information for each device is set in
* `response.perDeviceStatus.result.status`.
*/
error?: Schema$Status;
/**
* This field will contain a `DevicesLongRunningOperationMetadata` object if
* the operation is created by `claimAsync`, `unclaimAsync`, or
* `updateMetadataAsync`.
*/
metadata?: any;
/**
* The server-assigned name, which is only unique within the same service
* that originally returns it. If you use the default HTTP mapping, the
* `name` should have the format of `operations/some/unique/name`.
*/
name?: string;
/**
* This field will contain a `DevicesLongRunningOperationResponse` object if
* the operation is created by `claimAsync`, `unclaimAsync`, or
* `updateMetadataAsync`.
*/
response?: any;
}
/**
* A task for each device in the operation. Corresponds to each device change
* in the request.
*/
export interface Schema$OperationPerDevice {
/**
* A copy of the original device-claim request received by the server.
*/
claim?: Schema$PartnerClaim;
/**
* The processing result for each device.
*/
result?: Schema$PerDeviceStatusInBatch;
/**
* A copy of the original device-unclaim request received by the server.
*/
unclaim?: Schema$PartnerUnclaim;
/**
* A copy of the original metadata-update request received by the server.
*/
updateMetadata?: Schema$UpdateMetadataArguments;
}
/**
* Identifies one claim request.
*/
export interface Schema$PartnerClaim {
/**
* Required. The ID of the customer for whom the device is being claimed.
*/
customerId?: string;
/**
* Required. Device identifier of the device.
*/
deviceIdentifier?: Schema$DeviceIdentifier;
/**
* Required. The metadata to attach to the device at claim.
*/
deviceMetadata?: Schema$DeviceMetadata;
/**
* Required. The section type of the device's provisioning record.
*/
sectionType?: string;
}
/**
* Identifies one unclaim request.
*/
export interface Schema$PartnerUnclaim {
/**
* Device ID of the device.
*/
deviceId?: string;
/**
* Device identifier of the device.
*/
deviceIdentifier?: Schema$DeviceIdentifier;
/**
* Required. The section type of the device's provisioning record.
*/
sectionType?: string;
}
/**
* Captures the processing status for each device in the operation.
*/
export interface Schema$PerDeviceStatusInBatch {
/**
* If processing succeeds, the device ID of the device.
*/
deviceId?: string;
/**
* If processing fails, the error type.
*/
errorIdentifier?: string;
/**
* If processing fails, a developer message explaining what went wrong.
*/
errorMessage?: string;
/**
* The result status of the device after processing.
*/
status?: string;
}
/**
* The `Status` type defines a logical error model that is suitable for
* different programming environments, including REST APIs and RPC APIs. It is
* used by [gRPC](https://github.com/grpc). The error model is designed to be:
* - Simple to use and understand for most users - Flexible enough to meet
* unexpected needs # Overview The `Status` message contains three pieces of
* data: error code, error message, and error details. The error code should
* be an enum value of google.rpc.Code, but it may accept additional error
* codes if needed. The error message should be a developer-facing English
* message that helps developers *understand* and *resolve* the error. If a
* localized user-facing error message is needed, put the localized message in
* the error details or localize it in the client. The optional error details
* may contain arbitrary information about the error. There is a predefined
* set of error detail types in the package `google.rpc` that can be used for
* common error conditions. # Language mapping The `Status` message is the
* logical representation of the error model, but it is not necessarily the
* actual wire format. When the `Status` message is exposed in different
* client libraries and different wire protocols, it can be mapped
* differently. For example, it will likely be mapped to some exceptions in
* Java, but more likely mapped to some error codes in C. # Other uses The
* error model and the `Status` message can be used in a variety of
* environments, either with or without APIs, to provide a consistent
* developer experience across different environments. Example uses of this
* error model include: - Partial errors. If a service needs to return
* partial errors to the client, it may embed the `Status` in the normal
* response to indicate the partial errors. - Workflow errors. A typical
* workflow has multiple steps. Each step may have a `Status` message for
* error reporting. - Batch operations. If a client uses batch request and
* batch response, the `Status` message should be used directly inside
* batch response, one for each error sub-response. - Asynchronous
* operations. If an API call embeds asynchronous operation results in its
* response, the status of those operations should be represented directly
* using the `Status` message. - Logging. If some API errors are stored in
* logs, the message `Status` could be used directly after any stripping
* needed for security/privacy reasons.
*/
export interface Schema$Status {
/**
* The status code, which should be an enum value of google.rpc.Code.
*/
code?: number;
/**
* A list of messages that carry the error details. There is a common set
* of message types for APIs to use.
*/
details?: any[];
/**
* A developer-facing error message, which should be in English. Any
* user-facing error message should be localized and sent in the
* google.rpc.Status.details field, or localized by the client.
*/
message?: string;
}
/**
* Request message to unclaim a device.
*/
export interface Schema$UnclaimDeviceRequest {
/**
* The device ID returned by `ClaimDevice`.
*/
deviceId?: string;
/**
* The device identifier you used when you claimed this device.
*/
deviceIdentifier?: Schema$DeviceIdentifier;
/**
* Required. The section type of the device's provisioning record.
*/
sectionType?: string;
}
/**
* Request to unclaim devices asynchronously in batch.
*/
export interface Schema$UnclaimDevicesRequest {
/**
* Required. The list of devices to unclaim.
*/
unclaims?: Schema$PartnerUnclaim[];
}
/**
* Request to update device metadata in batch.
*/
export interface Schema$UpdateDeviceMetadataInBatchRequest {
/**
* Required. The list of metadata updates.
*/
updates?: Schema$UpdateMetadataArguments[];
}
/**
* Request to set metadata for a device.
*/
export interface Schema$UpdateDeviceMetadataRequest {
/**
* Required. The metdata to attach to the device.
*/
deviceMetadata?: Schema$DeviceMetadata;
}
/**
* Identifies metdata updates to one device.
*/
export interface Schema$UpdateMetadataArguments {
/**
* Device ID of the device.
*/
deviceId?: string;
/**
* Device identifier.
*/
deviceIdentifier?: Schema$DeviceIdentifier;
/**
* Required. The metadata to update.
*/
deviceMetadata?: Schema$DeviceMetadata;
}
export class Resource$Customers {
root: Androiddeviceprovisioning;
configurations: Resource$Customers$Configurations;
devices: Resource$Customers$Devices;
dpcs: Resource$Customers$Dpcs;
constructor(root: Androiddeviceprovisioning) {
this.root = root;
this.getRoot.bind(this);
this.configurations = new Resource$Customers$Configurations(root);
this.devices = new Resource$Customers$Devices(root);
this.dpcs = new Resource$Customers$Dpcs(root);
}
getRoot() {
return this.root;
}
/**
* androiddeviceprovisioning.customers.list
* @desc Lists the user's customer accounts.
* @alias androiddeviceprovisioning.customers.list
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {integer=} params.pageSize The maximum number of customers to show in a page of results. A number between 1 and 100 (inclusive).
* @param {string=} params.pageToken A token specifying which result page to return.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list(params?: Params$Resource$Customers$List, options?: MethodOptions):
AxiosPromise<Schema$CustomerListCustomersResponse>;
list(
params: Params$Resource$Customers$List,
options: MethodOptions|
BodyResponseCallback<Schema$CustomerListCustomersResponse>,
callback: BodyResponseCallback<Schema$CustomerListCustomersResponse>):
void;
list(
params: Params$Resource$Customers$List,
callback: BodyResponseCallback<Schema$CustomerListCustomersResponse>):
void;
list(callback: BodyResponseCallback<Schema$CustomerListCustomersResponse>):
void;
list(
paramsOrCallback?: Params$Resource$Customers$List|
BodyResponseCallback<Schema$CustomerListCustomersResponse>,
optionsOrCallback?: MethodOptions|
BodyResponseCallback<Schema$CustomerListCustomersResponse>,
callback?: BodyResponseCallback<Schema$CustomerListCustomersResponse>):
void|AxiosPromise<Schema$CustomerListCustomersResponse> {
let params = (paramsOrCallback || {}) as Params$Resource$Customers$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Customers$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl ||
'https://androiddeviceprovisioning.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/customers').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
},
options),
params,
requiredParams: [],
pathParams: [],
context: this.getRoot()
};
if (callback) {
createAPIRequest<Schema$CustomerListCustomersResponse>(
parameters, callback);
} else {
return createAPIRequest<Schema$CustomerListCustomersResponse>(
parameters);
}
}
}
export interface Params$Resource$Customers$List {
/**
* Auth client or API Key for the request
*/
auth?: string|OAuth2Client|JWT|Compute|UserRefreshClient;
/**
* The maximum number of customers to show in a page of results. A number
* between 1 and 100 (inclusive).
*/
pageSize?: number;
/**
* A token specifying which result page to return.
*/
pageToken?: string;
}
export class Resource$Customers$Configurations {
root: Androiddeviceprovisioning;
constructor(root: Androiddeviceprovisioning) {
this.root = root;
this.getRoot.bind(this);
}
getRoot() {
return this.root;
}
/**
* androiddeviceprovisioning.customers.configurations.create
* @desc Creates a new configuration. Once created, a customer can apply the
* configuration to devices.
* @alias androiddeviceprovisioning.customers.configurations.create
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.parent Required. The customer that manages the configuration. An API resource name in the format `customers/[CUSTOMER_ID]`.
* @param {().Configuration} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create(
params?: Params$Resource$Customers$Configurations$Create,
options?: MethodOptions): AxiosPromise<Schema$Configuration>;
create(
params: Params$Resource$Customers$Configurations$Create,
options: MethodOptions|BodyResponseCallback<Schema$Configuration>,
callback: BodyResponseCallback<Schema$Configuration>): void;
create(
params: Params$Resource$Customers$Configurations$Create,
callback: BodyResponseCallback<Schema$Configuration>): void;
create(callback: BodyResponseCallback<Schema$Configuration>): void;
create(
paramsOrCallback?: Params$Resource$Customers$Configurations$Create|
BodyResponseCallback<Schema$Configuration>,
optionsOrCallback?: MethodOptions|
BodyResponseCallback<Schema$Configuration>,
callback?: BodyResponseCallback<Schema$Configuration>):
void|AxiosPromise<Schema$Configuration> {
let params = (paramsOrCallback || {}) as
Params$Resource$Customers$Configurations$Create;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Customers$Configurations$Create;
options = {};
}