@maxim_mazurok/gapi.client.androiddeviceprovisioning-v1 0.0.20220808
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1612 -0
- package/package.json +20 -0
- package/readme.md +57 -0
- package/tests.ts +331 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.androiddeviceprovisioning-v1",
|
|
3
|
+
"version": "0.0.20220808",
|
|
4
|
+
"description": "TypeScript typings for Android Device Provisioning Partner API v1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# TypeScript typings for Android Device Provisioning Partner API v1
|
|
2
|
+
|
|
3
|
+
Automates Android zero-touch enrollment for device resellers, customers, and EMMs.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/zero-touch/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Android Device Provisioning Partner API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.androiddeviceprovisioning-v1 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://androiddeviceprovisioning.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.androiddeviceprovisioning
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('androiddeviceprovisioning', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.androiddeviceprovisioning
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
After that you can use Android Device Provisioning Partner API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
Lists the user's customer accounts.
|
|
50
|
+
*/
|
|
51
|
+
await gapi.client.androiddeviceprovisioning.customers.list({ });
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
55
|
+
*/
|
|
56
|
+
await gapi.client.androiddeviceprovisioning.operations.get({ name: "name", });
|
|
57
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.androiddeviceprovisioning-v1 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220808
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://androiddeviceprovisioning.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.androiddeviceprovisioning */
|
|
13
|
+
|
|
14
|
+
run();
|
|
15
|
+
|
|
16
|
+
async function run() {
|
|
17
|
+
/** Lists the user's customer accounts. */
|
|
18
|
+
await gapi.client.androiddeviceprovisioning.customers.list({
|
|
19
|
+
pageSize: 42,
|
|
20
|
+
pageToken: "Test string",
|
|
21
|
+
});
|
|
22
|
+
/** Creates a new configuration. Once created, a customer can apply the configuration to devices. */
|
|
23
|
+
await gapi.client.androiddeviceprovisioning.customers.configurations.create({
|
|
24
|
+
parent: "Test string",
|
|
25
|
+
}, {
|
|
26
|
+
companyName: "Test string",
|
|
27
|
+
configurationId: "Test string",
|
|
28
|
+
configurationName: "Test string",
|
|
29
|
+
contactEmail: "Test string",
|
|
30
|
+
contactPhone: "Test string",
|
|
31
|
+
customMessage: "Test string",
|
|
32
|
+
dpcExtras: "Test string",
|
|
33
|
+
dpcResourcePath: "Test string",
|
|
34
|
+
isDefault: true,
|
|
35
|
+
name: "Test string",
|
|
36
|
+
});
|
|
37
|
+
/** Deletes an unused configuration. The API call fails if the customer has devices with the configuration applied. */
|
|
38
|
+
await gapi.client.androiddeviceprovisioning.customers.configurations.delete({
|
|
39
|
+
name: "Test string",
|
|
40
|
+
});
|
|
41
|
+
/** Gets the details of a configuration. */
|
|
42
|
+
await gapi.client.androiddeviceprovisioning.customers.configurations.get({
|
|
43
|
+
name: "Test string",
|
|
44
|
+
});
|
|
45
|
+
/** Lists a customer's configurations. */
|
|
46
|
+
await gapi.client.androiddeviceprovisioning.customers.configurations.list({
|
|
47
|
+
parent: "Test string",
|
|
48
|
+
});
|
|
49
|
+
/** Updates a configuration's field values. */
|
|
50
|
+
await gapi.client.androiddeviceprovisioning.customers.configurations.patch({
|
|
51
|
+
name: "Test string",
|
|
52
|
+
updateMask: "Test string",
|
|
53
|
+
}, {
|
|
54
|
+
companyName: "Test string",
|
|
55
|
+
configurationId: "Test string",
|
|
56
|
+
configurationName: "Test string",
|
|
57
|
+
contactEmail: "Test string",
|
|
58
|
+
contactPhone: "Test string",
|
|
59
|
+
customMessage: "Test string",
|
|
60
|
+
dpcExtras: "Test string",
|
|
61
|
+
dpcResourcePath: "Test string",
|
|
62
|
+
isDefault: true,
|
|
63
|
+
name: "Test string",
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Applies a Configuration to the device to register the device for zero-touch enrollment. After applying a configuration to a device, the device automatically provisions itself on first
|
|
67
|
+
* boot, or next factory reset.
|
|
68
|
+
*/
|
|
69
|
+
await gapi.client.androiddeviceprovisioning.customers.devices.applyConfiguration({
|
|
70
|
+
parent: "Test string",
|
|
71
|
+
}, {
|
|
72
|
+
configuration: "Test string",
|
|
73
|
+
device: {
|
|
74
|
+
deviceId: "Test string",
|
|
75
|
+
deviceIdentifier: {
|
|
76
|
+
imei: "Test string",
|
|
77
|
+
manufacturer: "Test string",
|
|
78
|
+
meid: "Test string",
|
|
79
|
+
model: "Test string",
|
|
80
|
+
serialNumber: "Test string",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
/** Gets the details of a device. */
|
|
85
|
+
await gapi.client.androiddeviceprovisioning.customers.devices.get({
|
|
86
|
+
name: "Test string",
|
|
87
|
+
});
|
|
88
|
+
/** Lists a customer's devices. */
|
|
89
|
+
await gapi.client.androiddeviceprovisioning.customers.devices.list({
|
|
90
|
+
pageSize: "Test string",
|
|
91
|
+
pageToken: "Test string",
|
|
92
|
+
parent: "Test string",
|
|
93
|
+
});
|
|
94
|
+
/** Removes a configuration from device. */
|
|
95
|
+
await gapi.client.androiddeviceprovisioning.customers.devices.removeConfiguration({
|
|
96
|
+
parent: "Test string",
|
|
97
|
+
}, {
|
|
98
|
+
device: {
|
|
99
|
+
deviceId: "Test string",
|
|
100
|
+
deviceIdentifier: {
|
|
101
|
+
imei: "Test string",
|
|
102
|
+
manufacturer: "Test string",
|
|
103
|
+
meid: "Test string",
|
|
104
|
+
model: "Test string",
|
|
105
|
+
serialNumber: "Test string",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Unclaims a device from a customer and removes it from zero-touch enrollment. After removing a device, a customer must contact their reseller to register the device into zero-touch
|
|
111
|
+
* enrollment again.
|
|
112
|
+
*/
|
|
113
|
+
await gapi.client.androiddeviceprovisioning.customers.devices.unclaim({
|
|
114
|
+
parent: "Test string",
|
|
115
|
+
}, {
|
|
116
|
+
device: {
|
|
117
|
+
deviceId: "Test string",
|
|
118
|
+
deviceIdentifier: {
|
|
119
|
+
imei: "Test string",
|
|
120
|
+
manufacturer: "Test string",
|
|
121
|
+
meid: "Test string",
|
|
122
|
+
model: "Test string",
|
|
123
|
+
serialNumber: "Test string",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
/** Lists the DPCs (device policy controllers) that support zero-touch enrollment. */
|
|
128
|
+
await gapi.client.androiddeviceprovisioning.customers.dpcs.list({
|
|
129
|
+
parent: "Test string",
|
|
130
|
+
});
|
|
131
|
+
/** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
|
|
132
|
+
await gapi.client.androiddeviceprovisioning.operations.get({
|
|
133
|
+
name: "Test string",
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Creates a customer for zero-touch enrollment. After the method returns successfully, admin and owner roles can manage devices and EMM configs by calling API methods or using their
|
|
137
|
+
* zero-touch enrollment portal. The customer receives an email that welcomes them to zero-touch enrollment and explains how to sign into the portal.
|
|
138
|
+
*/
|
|
139
|
+
await gapi.client.androiddeviceprovisioning.partners.customers.create({
|
|
140
|
+
parent: "Test string",
|
|
141
|
+
}, {
|
|
142
|
+
customer: {
|
|
143
|
+
adminEmails: [
|
|
144
|
+
"Test string"
|
|
145
|
+
],
|
|
146
|
+
companyId: "Test string",
|
|
147
|
+
companyName: "Test string",
|
|
148
|
+
languageCode: "Test string",
|
|
149
|
+
name: "Test string",
|
|
150
|
+
ownerEmails: [
|
|
151
|
+
"Test string"
|
|
152
|
+
],
|
|
153
|
+
skipWelcomeEmail: true,
|
|
154
|
+
termsStatus: "Test string",
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* Lists the customers that are enrolled to the reseller identified by the `partnerId` argument. This list includes customers that the reseller created and customers that enrolled
|
|
159
|
+
* themselves using the portal.
|
|
160
|
+
*/
|
|
161
|
+
await gapi.client.androiddeviceprovisioning.partners.customers.list({
|
|
162
|
+
pageSize: 42,
|
|
163
|
+
pageToken: "Test string",
|
|
164
|
+
partnerId: "Test string",
|
|
165
|
+
});
|
|
166
|
+
/** Claims a device for a customer and adds it to zero-touch enrollment. If the device is already claimed by another customer, the call returns an error. */
|
|
167
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.claim({
|
|
168
|
+
partnerId: "Test string",
|
|
169
|
+
}, {
|
|
170
|
+
customerId: "Test string",
|
|
171
|
+
deviceIdentifier: {
|
|
172
|
+
imei: "Test string",
|
|
173
|
+
manufacturer: "Test string",
|
|
174
|
+
meid: "Test string",
|
|
175
|
+
model: "Test string",
|
|
176
|
+
serialNumber: "Test string",
|
|
177
|
+
},
|
|
178
|
+
deviceMetadata: {
|
|
179
|
+
entries: {
|
|
180
|
+
A: "Test string"
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
sectionType: "Test string",
|
|
184
|
+
});
|
|
185
|
+
/**
|
|
186
|
+
* Claims a batch of devices for a customer asynchronously. Adds the devices to zero-touch enrollment. To learn more, read [Long‑running batch
|
|
187
|
+
* operations](/zero-touch/guides/how-it-works#operations).
|
|
188
|
+
*/
|
|
189
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.claimAsync({
|
|
190
|
+
partnerId: "Test string",
|
|
191
|
+
}, {
|
|
192
|
+
claims: [
|
|
193
|
+
{
|
|
194
|
+
customerId: "Test string",
|
|
195
|
+
deviceIdentifier: {
|
|
196
|
+
imei: "Test string",
|
|
197
|
+
manufacturer: "Test string",
|
|
198
|
+
meid: "Test string",
|
|
199
|
+
model: "Test string",
|
|
200
|
+
serialNumber: "Test string",
|
|
201
|
+
},
|
|
202
|
+
deviceMetadata: {
|
|
203
|
+
entries: {
|
|
204
|
+
A: "Test string"
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
sectionType: "Test string",
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
});
|
|
211
|
+
/** Finds devices by hardware identifiers, such as IMEI. */
|
|
212
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.findByIdentifier({
|
|
213
|
+
partnerId: "Test string",
|
|
214
|
+
}, {
|
|
215
|
+
deviceIdentifier: {
|
|
216
|
+
imei: "Test string",
|
|
217
|
+
manufacturer: "Test string",
|
|
218
|
+
meid: "Test string",
|
|
219
|
+
model: "Test string",
|
|
220
|
+
serialNumber: "Test string",
|
|
221
|
+
},
|
|
222
|
+
limit: "Test string",
|
|
223
|
+
pageToken: "Test string",
|
|
224
|
+
});
|
|
225
|
+
/**
|
|
226
|
+
* Finds devices claimed for customers. The results only contain devices registered to the reseller that's identified by the `partnerId` argument. The customer's devices purchased from
|
|
227
|
+
* other resellers don't appear in the results.
|
|
228
|
+
*/
|
|
229
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.findByOwner({
|
|
230
|
+
partnerId: "Test string",
|
|
231
|
+
}, {
|
|
232
|
+
customerId: [
|
|
233
|
+
"Test string"
|
|
234
|
+
],
|
|
235
|
+
limit: "Test string",
|
|
236
|
+
pageToken: "Test string",
|
|
237
|
+
sectionType: "Test string",
|
|
238
|
+
});
|
|
239
|
+
/** Gets a device. */
|
|
240
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.get({
|
|
241
|
+
name: "Test string",
|
|
242
|
+
});
|
|
243
|
+
/** Updates reseller metadata associated with the device. */
|
|
244
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.metadata({
|
|
245
|
+
deviceId: "Test string",
|
|
246
|
+
metadataOwnerId: "Test string",
|
|
247
|
+
}, {
|
|
248
|
+
deviceMetadata: {
|
|
249
|
+
entries: {
|
|
250
|
+
A: "Test string"
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
/** Unclaims a device from a customer and removes it from zero-touch enrollment. */
|
|
255
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.unclaim({
|
|
256
|
+
partnerId: "Test string",
|
|
257
|
+
}, {
|
|
258
|
+
deviceId: "Test string",
|
|
259
|
+
deviceIdentifier: {
|
|
260
|
+
imei: "Test string",
|
|
261
|
+
manufacturer: "Test string",
|
|
262
|
+
meid: "Test string",
|
|
263
|
+
model: "Test string",
|
|
264
|
+
serialNumber: "Test string",
|
|
265
|
+
},
|
|
266
|
+
sectionType: "Test string",
|
|
267
|
+
vacationModeDays: 42,
|
|
268
|
+
vacationModeExpireTime: "Test string",
|
|
269
|
+
});
|
|
270
|
+
/**
|
|
271
|
+
* Unclaims a batch of devices for a customer asynchronously. Removes the devices from zero-touch enrollment. To learn more, read [Long‑running batch
|
|
272
|
+
* operations](/zero-touch/guides/how-it-works#operations).
|
|
273
|
+
*/
|
|
274
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.unclaimAsync({
|
|
275
|
+
partnerId: "Test string",
|
|
276
|
+
}, {
|
|
277
|
+
unclaims: [
|
|
278
|
+
{
|
|
279
|
+
deviceId: "Test string",
|
|
280
|
+
deviceIdentifier: {
|
|
281
|
+
imei: "Test string",
|
|
282
|
+
manufacturer: "Test string",
|
|
283
|
+
meid: "Test string",
|
|
284
|
+
model: "Test string",
|
|
285
|
+
serialNumber: "Test string",
|
|
286
|
+
},
|
|
287
|
+
sectionType: "Test string",
|
|
288
|
+
vacationModeDays: 42,
|
|
289
|
+
vacationModeExpireTime: "Test string",
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
});
|
|
293
|
+
/**
|
|
294
|
+
* Updates the reseller metadata attached to a batch of devices. This method updates devices asynchronously and returns an `Operation` that can be used to track progress. Read
|
|
295
|
+
* [Long‑running batch operations](/zero-touch/guides/how-it-works#operations).
|
|
296
|
+
*/
|
|
297
|
+
await gapi.client.androiddeviceprovisioning.partners.devices.updateMetadataAsync({
|
|
298
|
+
partnerId: "Test string",
|
|
299
|
+
}, {
|
|
300
|
+
updates: [
|
|
301
|
+
{
|
|
302
|
+
deviceId: "Test string",
|
|
303
|
+
deviceIdentifier: {
|
|
304
|
+
imei: "Test string",
|
|
305
|
+
manufacturer: "Test string",
|
|
306
|
+
meid: "Test string",
|
|
307
|
+
model: "Test string",
|
|
308
|
+
serialNumber: "Test string",
|
|
309
|
+
},
|
|
310
|
+
deviceMetadata: {
|
|
311
|
+
entries: {
|
|
312
|
+
A: "Test string"
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
});
|
|
318
|
+
/** Lists the vendors of the partner. */
|
|
319
|
+
await gapi.client.androiddeviceprovisioning.partners.vendors.list({
|
|
320
|
+
pageSize: 42,
|
|
321
|
+
pageToken: "Test string",
|
|
322
|
+
parent: "Test string",
|
|
323
|
+
});
|
|
324
|
+
/** Lists the customers of the vendor. */
|
|
325
|
+
await gapi.client.androiddeviceprovisioning.partners.vendors.customers.list({
|
|
326
|
+
pageSize: 42,
|
|
327
|
+
pageToken: "Test string",
|
|
328
|
+
parent: "Test string",
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": ["es6", "dom"],
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"baseUrl": "../",
|
|
9
|
+
"typeRoots": [
|
|
10
|
+
"../"
|
|
11
|
+
],
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"strictFunctionTypes": true
|
|
16
|
+
},
|
|
17
|
+
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
+
}
|