From 1c18b1665587b2d59e7bec78acb695017424aa9f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Fri, 10 Feb 2023 01:40:47 +0000 Subject: [PATCH] feat(chromemanagement): update the API #### chromemanagement:v1 The following keys were added: - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.description - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.flatPath - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.httpMethod - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.id - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameterOrder - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.customer.description - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.customer.location - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.customer.pattern - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.customer.required - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.customer.type - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.orgUnitId.description - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.orgUnitId.location - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.parameters.orgUnitId.type - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.path - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.response.$ref - resources.customers.resources.reports.methods.countChromeBrowsersNeedingAttention.scopes - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.description - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.id - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.noRecentActivityCount.description - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.noRecentActivityCount.format - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.noRecentActivityCount.type - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.pendingBrowserUpdateCount.description - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.pendingBrowserUpdateCount.format - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.pendingBrowserUpdateCount.type - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.recentlyEnrolledCount.description - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.recentlyEnrolledCount.format - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.properties.recentlyEnrolledCount.type - schemas.GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse.type --- discovery/chromemanagement-v1.json | 54 ++++++++- src/apis/chromemanagement/v1.ts | 177 +++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+), 1 deletion(-) diff --git a/discovery/chromemanagement-v1.json b/discovery/chromemanagement-v1.json index 722818dfd3..a906641732 100644 --- a/discovery/chromemanagement-v1.json +++ b/discovery/chromemanagement-v1.json @@ -254,6 +254,36 @@ }, "reports": { "methods": { + "countChromeBrowsersNeedingAttention": { + "description": "Count of Chrome Browsers that have been recently enrolled, have new policy to be synced, or have no recent activity.", + "flatPath": "v1/customers/{customersId}/reports:countChromeBrowsersNeedingAttention", + "httpMethod": "GET", + "id": "chromemanagement.customers.reports.countChromeBrowsersNeedingAttention", + "parameterOrder": [ + "customer" + ], + "parameters": { + "customer": { + "description": "Required. The customer ID or \"my_customer\" prefixed with \"customers/\".", + "location": "path", + "pattern": "^customers/[^/]+$", + "required": true, + "type": "string" + }, + "orgUnitId": { + "description": "Optional. The ID of the organizational unit. If omitted, all data will be returned.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+customer}/reports:countChromeBrowsersNeedingAttention", + "response": { + "$ref": "GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/chrome.management.reports.readonly" + ] + }, "countChromeDevicesReachingAutoExpirationDate": { "description": "Generate report of the number of devices expiring in each month of the selected time frame. Devices are grouped by auto update expiration date and model. Further information can be found [here](https://support.google.com/chrome/a/answer/10564947).", "flatPath": "v1/customers/{customersId}/reports:countChromeDevicesReachingAutoExpirationDate", @@ -764,7 +794,7 @@ } } }, - "revision": "20230208", + "revision": "20230209", "rootUrl": "https://chromemanagement.googleapis.com/", "schemas": { "GoogleChromeManagementV1AndroidAppInfo": { @@ -1402,6 +1432,28 @@ }, "type": "object" }, + "GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse": { + "description": "Response containing counts for browsers that need attention.", + "id": "GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse", + "properties": { + "noRecentActivityCount": { + "description": "Number of browsers that haven’t had any recent activity", + "format": "int64", + "type": "string" + }, + "pendingBrowserUpdateCount": { + "description": "Number of browsers that are pending an OS update", + "format": "int64", + "type": "string" + }, + "recentlyEnrolledCount": { + "description": "Number of browsers that have been recently enrolled", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, "GoogleChromeManagementV1CountChromeDevicesReachingAutoExpirationDateResponse": { "description": "Response containing a list of devices expiring in each month of a selected time frame. Counts are grouped by model and Auto Update Expiration date.", "id": "GoogleChromeManagementV1CountChromeDevicesReachingAutoExpirationDateResponse", diff --git a/src/apis/chromemanagement/v1.ts b/src/apis/chromemanagement/v1.ts index 4ec2c60e71..e34bc2ebbc 100644 --- a/src/apis/chromemanagement/v1.ts +++ b/src/apis/chromemanagement/v1.ts @@ -530,6 +530,23 @@ export namespace chromemanagement_v1 { */ totalSize?: number | null; } + /** + * Response containing counts for browsers that need attention. + */ + export interface Schema$GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse { + /** + * Number of browsers that haven’t had any recent activity + */ + noRecentActivityCount?: string | null; + /** + * Number of browsers that are pending an OS update + */ + pendingBrowserUpdateCount?: string | null; + /** + * Number of browsers that have been recently enrolled + */ + recentlyEnrolledCount?: string | null; + } /** * Response containing a list of devices expiring in each month of a selected time frame. Counts are grouped by model and Auto Update Expiration date. */ @@ -2257,6 +2274,155 @@ export namespace chromemanagement_v1 { this.context = context; } + /** + * Count of Chrome Browsers that have been recently enrolled, have new policy to be synced, or have no recent activity. + * @example + * ```js + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chromemanagement.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const chromemanagement = google.chromemanagement('v1'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/chrome.management.reports.readonly', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = + * await chromemanagement.customers.reports.countChromeBrowsersNeedingAttention( + * { + * // Required. The customer ID or "my_customer" prefixed with "customers/". + * customer: 'customers/my-customer', + * // Optional. The ID of the organizational unit. If omitted, all data will be returned. + * orgUnitId: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "noRecentActivityCount": "my_noRecentActivityCount", + * // "pendingBrowserUpdateCount": "my_pendingBrowserUpdateCount", + * // "recentlyEnrolledCount": "my_recentlyEnrolledCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * ``` + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + countChromeBrowsersNeedingAttention( + params: Params$Resource$Customers$Reports$Countchromebrowsersneedingattention, + options: StreamMethodOptions + ): GaxiosPromise; + countChromeBrowsersNeedingAttention( + params?: Params$Resource$Customers$Reports$Countchromebrowsersneedingattention, + options?: MethodOptions + ): GaxiosPromise; + countChromeBrowsersNeedingAttention( + params: Params$Resource$Customers$Reports$Countchromebrowsersneedingattention, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + countChromeBrowsersNeedingAttention( + params: Params$Resource$Customers$Reports$Countchromebrowsersneedingattention, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + countChromeBrowsersNeedingAttention( + params: Params$Resource$Customers$Reports$Countchromebrowsersneedingattention, + callback: BodyResponseCallback + ): void; + countChromeBrowsersNeedingAttention( + callback: BodyResponseCallback + ): void; + countChromeBrowsersNeedingAttention( + paramsOrCallback?: + | Params$Resource$Customers$Reports$Countchromebrowsersneedingattention + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Customers$Reports$Countchromebrowsersneedingattention; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Customers$Reports$Countchromebrowsersneedingattention; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://chromemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/v1/{+customer}/reports:countChromeBrowsersNeedingAttention' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest( + parameters + ); + } + } + /** * Generate report of the number of devices expiring in each month of the selected time frame. Devices are grouped by auto update expiration date and model. Further information can be found [here](https://support.google.com/chrome/a/answer/10564947). * @example @@ -3171,6 +3337,17 @@ export namespace chromemanagement_v1 { } } + export interface Params$Resource$Customers$Reports$Countchromebrowsersneedingattention + extends StandardParameters { + /** + * Required. The customer ID or "my_customer" prefixed with "customers/". + */ + customer?: string; + /** + * Optional. The ID of the organizational unit. If omitted, all data will be returned. + */ + orgUnitId?: string; + } export interface Params$Resource$Customers$Reports$Countchromedevicesreachingautoexpirationdate extends StandardParameters { /**