Skip to content

Commit 27be4ae

Browse files
yoshi-automationBenjamin E. Coe
authored andcommitted
feat(androidenterprise): update the API
#### androidenterprise:v1 The following keys were added: - resources.enterprises.methods.createEnrollmentToken.description - resources.enterprises.methods.createEnrollmentToken.flatPath - resources.enterprises.methods.createEnrollmentToken.httpMethod - resources.enterprises.methods.createEnrollmentToken.id - resources.enterprises.methods.createEnrollmentToken.parameterOrder - resources.enterprises.methods.createEnrollmentToken.parameters.deviceType.description - resources.enterprises.methods.createEnrollmentToken.parameters.deviceType.enum - resources.enterprises.methods.createEnrollmentToken.parameters.deviceType.enumDescriptions - resources.enterprises.methods.createEnrollmentToken.parameters.deviceType.location - resources.enterprises.methods.createEnrollmentToken.parameters.deviceType.type - resources.enterprises.methods.createEnrollmentToken.parameters.enterpriseId.description - resources.enterprises.methods.createEnrollmentToken.parameters.enterpriseId.location - resources.enterprises.methods.createEnrollmentToken.parameters.enterpriseId.required - resources.enterprises.methods.createEnrollmentToken.parameters.enterpriseId.type - resources.enterprises.methods.createEnrollmentToken.path - resources.enterprises.methods.createEnrollmentToken.response.$ref - resources.enterprises.methods.createEnrollmentToken.scopes - schemas.CreateEnrollmentTokenResponse.description - schemas.CreateEnrollmentTokenResponse.id - schemas.CreateEnrollmentTokenResponse.properties.enrollmentToken.description - schemas.CreateEnrollmentTokenResponse.properties.enrollmentToken.type - schemas.CreateEnrollmentTokenResponse.type The following keys were changed: - resources.enterprises.methods.pullNotificationSet.parameters.requestMode.description
1 parent c59088d commit 27be4ae

File tree

2 files changed

+215
-4
lines changed

2 files changed

+215
-4
lines changed

discovery/androidenterprise-v1.json

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,45 @@
383383
"https://www.googleapis.com/auth/androidenterprise"
384384
]
385385
},
386+
"createEnrollmentToken": {
387+
"description": "Returns a token for device enrollment. The DPC can encode this token within the QR/NFC/zero-touch enrollment payload or fetch it before calling the on-device API to authenticate the user. The token can be generated for each device or reused across multiple devices.",
388+
"flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/createEnrollmentToken",
389+
"httpMethod": "POST",
390+
"id": "androidenterprise.enterprises.createEnrollmentToken",
391+
"parameterOrder": [
392+
"enterpriseId"
393+
],
394+
"parameters": {
395+
"deviceType": {
396+
"description": "Whether it’s a dedicated device or a knowledge worker device.",
397+
"enum": [
398+
"unknown",
399+
"dedicatedDevice",
400+
"knowledgeWorker"
401+
],
402+
"enumDescriptions": [
403+
"This value is unused",
404+
"This device is a dedicated device.",
405+
"This device is required to have an authenticated user."
406+
],
407+
"location": "query",
408+
"type": "string"
409+
},
410+
"enterpriseId": {
411+
"description": "The ID of the enterprise.",
412+
"location": "path",
413+
"required": true,
414+
"type": "string"
415+
}
416+
},
417+
"path": "androidenterprise/v1/enterprises/{enterpriseId}/createEnrollmentToken",
418+
"response": {
419+
"$ref": "CreateEnrollmentTokenResponse"
420+
},
421+
"scopes": [
422+
"https://www.googleapis.com/auth/androidenterprise"
423+
]
424+
},
386425
"createWebToken": {
387426
"description": "Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information.",
388427
"flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/createWebToken",
@@ -575,7 +614,7 @@
575614
"parameterOrder": [],
576615
"parameters": {
577616
"requestMode": {
578-
"description": "The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.",
617+
"description": "The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Specifying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.",
579618
"enum": [
580619
"waitForNotifications",
581620
"returnImmediately"
@@ -2610,7 +2649,7 @@
26102649
}
26112650
}
26122651
},
2613-
"revision": "20221025",
2652+
"revision": "20221214",
26142653
"rootUrl": "https://androidenterprise.googleapis.com/",
26152654
"schemas": {
26162655
"Administrator": {
@@ -3099,6 +3138,17 @@
30993138
},
31003139
"type": "object"
31013140
},
3141+
"CreateEnrollmentTokenResponse": {
3142+
"description": "Response message for create enrollment token.",
3143+
"id": "CreateEnrollmentTokenResponse",
3144+
"properties": {
3145+
"enrollmentToken": {
3146+
"description": "Enrollment token.",
3147+
"type": "string"
3148+
}
3149+
},
3150+
"type": "object"
3151+
},
31023152
"Device": {
31033153
"description": "A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.",
31043154
"id": "Device",

src/apis/androidenterprise/v1.ts

Lines changed: 163 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,15 @@ export namespace androidenterprise_v1 {
449449
*/
450450
variableSet?: Schema$VariableSet[];
451451
}
452+
/**
453+
* Response message for create enrollment token.
454+
*/
455+
export interface Schema$CreateEnrollmentTokenResponse {
456+
/**
457+
* Enrollment token.
458+
*/
459+
enrollmentToken?: string | null;
460+
}
452461
/**
453462
* A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.
454463
*/
@@ -2676,6 +2685,147 @@ export namespace androidenterprise_v1 {
26762685
}
26772686
}
26782687

2688+
/**
2689+
* Returns a token for device enrollment. The DPC can encode this token within the QR/NFC/zero-touch enrollment payload or fetch it before calling the on-device API to authenticate the user. The token can be generated for each device or reused across multiple devices.
2690+
* @example
2691+
* ```js
2692+
* // Before running the sample:
2693+
* // - Enable the API at:
2694+
* // https://console.developers.google.com/apis/api/androidenterprise.googleapis.com
2695+
* // - Login into gcloud by running:
2696+
* // `$ gcloud auth application-default login`
2697+
* // - Install the npm module by running:
2698+
* // `$ npm install googleapis`
2699+
*
2700+
* const {google} = require('googleapis');
2701+
* const androidenterprise = google.androidenterprise('v1');
2702+
*
2703+
* async function main() {
2704+
* const auth = new google.auth.GoogleAuth({
2705+
* // Scopes can be specified either as an array or as a single, space-delimited string.
2706+
* scopes: ['https://www.googleapis.com/auth/androidenterprise'],
2707+
* });
2708+
*
2709+
* // Acquire an auth client, and bind it to all future calls
2710+
* const authClient = await auth.getClient();
2711+
* google.options({auth: authClient});
2712+
*
2713+
* // Do the magic
2714+
* const res = await androidenterprise.enterprises.createEnrollmentToken({
2715+
* // Whether it’s a dedicated device or a knowledge worker device.
2716+
* deviceType: 'placeholder-value',
2717+
* // The ID of the enterprise.
2718+
* enterpriseId: 'placeholder-value',
2719+
* });
2720+
* console.log(res.data);
2721+
*
2722+
* // Example response
2723+
* // {
2724+
* // "enrollmentToken": "my_enrollmentToken"
2725+
* // }
2726+
* }
2727+
*
2728+
* main().catch(e => {
2729+
* console.error(e);
2730+
* throw e;
2731+
* });
2732+
*
2733+
* ```
2734+
*
2735+
* @param params - Parameters for request
2736+
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2737+
* @param callback - Optional callback that handles the response.
2738+
* @returns A promise if used with async/await, or void if used with a callback.
2739+
*/
2740+
createEnrollmentToken(
2741+
params: Params$Resource$Enterprises$Createenrollmenttoken,
2742+
options: StreamMethodOptions
2743+
): GaxiosPromise<Readable>;
2744+
createEnrollmentToken(
2745+
params?: Params$Resource$Enterprises$Createenrollmenttoken,
2746+
options?: MethodOptions
2747+
): GaxiosPromise<Schema$CreateEnrollmentTokenResponse>;
2748+
createEnrollmentToken(
2749+
params: Params$Resource$Enterprises$Createenrollmenttoken,
2750+
options: StreamMethodOptions | BodyResponseCallback<Readable>,
2751+
callback: BodyResponseCallback<Readable>
2752+
): void;
2753+
createEnrollmentToken(
2754+
params: Params$Resource$Enterprises$Createenrollmenttoken,
2755+
options:
2756+
| MethodOptions
2757+
| BodyResponseCallback<Schema$CreateEnrollmentTokenResponse>,
2758+
callback: BodyResponseCallback<Schema$CreateEnrollmentTokenResponse>
2759+
): void;
2760+
createEnrollmentToken(
2761+
params: Params$Resource$Enterprises$Createenrollmenttoken,
2762+
callback: BodyResponseCallback<Schema$CreateEnrollmentTokenResponse>
2763+
): void;
2764+
createEnrollmentToken(
2765+
callback: BodyResponseCallback<Schema$CreateEnrollmentTokenResponse>
2766+
): void;
2767+
createEnrollmentToken(
2768+
paramsOrCallback?:
2769+
| Params$Resource$Enterprises$Createenrollmenttoken
2770+
| BodyResponseCallback<Schema$CreateEnrollmentTokenResponse>
2771+
| BodyResponseCallback<Readable>,
2772+
optionsOrCallback?:
2773+
| MethodOptions
2774+
| StreamMethodOptions
2775+
| BodyResponseCallback<Schema$CreateEnrollmentTokenResponse>
2776+
| BodyResponseCallback<Readable>,
2777+
callback?:
2778+
| BodyResponseCallback<Schema$CreateEnrollmentTokenResponse>
2779+
| BodyResponseCallback<Readable>
2780+
):
2781+
| void
2782+
| GaxiosPromise<Schema$CreateEnrollmentTokenResponse>
2783+
| GaxiosPromise<Readable> {
2784+
let params = (paramsOrCallback ||
2785+
{}) as Params$Resource$Enterprises$Createenrollmenttoken;
2786+
let options = (optionsOrCallback || {}) as MethodOptions;
2787+
2788+
if (typeof paramsOrCallback === 'function') {
2789+
callback = paramsOrCallback;
2790+
params = {} as Params$Resource$Enterprises$Createenrollmenttoken;
2791+
options = {};
2792+
}
2793+
2794+
if (typeof optionsOrCallback === 'function') {
2795+
callback = optionsOrCallback;
2796+
options = {};
2797+
}
2798+
2799+
const rootUrl =
2800+
options.rootUrl || 'https://androidenterprise.googleapis.com/';
2801+
const parameters = {
2802+
options: Object.assign(
2803+
{
2804+
url: (
2805+
rootUrl +
2806+
'/androidenterprise/v1/enterprises/{enterpriseId}/createEnrollmentToken'
2807+
).replace(/([^:]\/)\/+/g, '$1'),
2808+
method: 'POST',
2809+
},
2810+
options
2811+
),
2812+
params,
2813+
requiredParams: ['enterpriseId'],
2814+
pathParams: ['enterpriseId'],
2815+
context: this.context,
2816+
};
2817+
if (callback) {
2818+
createAPIRequest<Schema$CreateEnrollmentTokenResponse>(
2819+
parameters,
2820+
callback as BodyResponseCallback<unknown>
2821+
);
2822+
} else {
2823+
return createAPIRequest<Schema$CreateEnrollmentTokenResponse>(
2824+
parameters
2825+
);
2826+
}
2827+
}
2828+
26792829
/**
26802830
* Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information.
26812831
* @example
@@ -3661,7 +3811,7 @@ export namespace androidenterprise_v1 {
36613811
*
36623812
* // Do the magic
36633813
* const res = await androidenterprise.enterprises.pullNotificationSet({
3664-
* // The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.
3814+
* // The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Specifying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.
36653815
* requestMode: 'placeholder-value',
36663816
* });
36673817
* console.log(res.data);
@@ -4329,6 +4479,17 @@ export namespace androidenterprise_v1 {
43294479
*/
43304480
enterpriseToken?: string;
43314481
}
4482+
export interface Params$Resource$Enterprises$Createenrollmenttoken
4483+
extends StandardParameters {
4484+
/**
4485+
* Whether it’s a dedicated device or a knowledge worker device.
4486+
*/
4487+
deviceType?: string;
4488+
/**
4489+
* The ID of the enterprise.
4490+
*/
4491+
enterpriseId?: string;
4492+
}
43324493
export interface Params$Resource$Enterprises$Createwebtoken
43334494
extends StandardParameters {
43344495
/**
@@ -4393,7 +4554,7 @@ export namespace androidenterprise_v1 {
43934554
export interface Params$Resource$Enterprises$Pullnotificationset
43944555
extends StandardParameters {
43954556
/**
4396-
* The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.
4557+
* The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Specifying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.
43974558
*/
43984559
requestMode?: string;
43994560
}

0 commit comments

Comments
 (0)